With 100 percent of the county's precincts reporting, Measure B passed 56 percent to 44 percent.
The AIDS Healthcare Foundation, which sponsored the initiative, says the measure will help safeguard public health as well as porn workers' health.
Opponents, largely members of the porn film industry, which is based in Los Angeles, say the business polices itself and no one has contracted HIV on a film set in the United States since 2004.
The industry says performers are already required to undergo monthly HIV tests.
Film producers also say the measure could prompt the $1 billion industry to leave Los Angeles, taking thousands of jobs with it.