California gubernatorial primary a test of Trump resistance Californians head to the polls in a primary the whole nation will be watching.

Californians head to the polls Tuesday to narrow down their choices for a new governor in the nation’s largest, and possibly bluest, state.

In this current political climate, the California governor will likely continue to serve as a de facto leader of the so-called “resistance” against President Donald Trump. The Golden State so far has sued the administration repeatedly and positioned itself as a counterweight to the conservative policies coming out of the nation's capital.

With 40 million people, the world’s fifth largest economy, and a state government lead by a majority of Democrats in every branch, California liberals find themselves in a unique position to stand against Republicans in Washington on major issues such as climate change, healthcare, and net neutrality.

California’s next governor will inherit a state with a $9 billion budget surplus, and a state legislature committed to protecting liberal positions the Trump administration has been working to roll back.

The Democratic nominees for governor will be expected to lead the party nationally on hot-button issues such as immigration policy, healthcare reform, and curbing climate change. California’s status as a “sanctuary state” is currently being challenged in the courts, and a new governor will have a chance to introduce single-payer healthcare legislation for the state.

Leading the race is the state’s lieutenant governor and former mayor of San Francisco, Gavin Newsom. Newsom is the longtime polls and fundraising leader, running as a progressive ahead of his time who allowed same-sex marriages in San Francisco before it was supported by the Democratic Party.

In the past, the state's governors -- like Jerry Brown or Ronald Reagan -- capitalized on the built-in national profile that comes with the job and huge executive responsibilities and were able to position themselves to run for president.

Though there has been some speculation that Newsom might do the same, a Newsom spokesperson directed ABC News to an interview in which the candidate vowed not to run for president if elected governor.

While Democrats agree on many political issues, Newsom and his competitors are selling themselves as the candidate best positioned to “stand up to Trump.” Antonio Villaraigosa, former Los Angeles mayor, is Newsom’s top competition from the Democratic Party.

The competition initially set up as a north vs. south fight between the former mayors of San Francisco and Los Angeles. Both Newsom and Villaraigosa received the endorsement of their major hometown papers –- the San Francisco Chronicle and the Los Angeles Times, respectively –- and seem to enjoy strongholds of support in their home communities.

Democrats’ dreams of taking both of the top two primary positions may be dashed by a late surge by Trump-backed John Cox, a San Diego businessman running as a Republican.

Cox admits he did not vote for Donald Trump in 2016, and his support for many of the president’s policies has been tepid throughout the campaign, but received the president’s endorsement via Twitter in May.

Republican support was split between two candidates prior to the endorsement, but polls show it has coalesced behind Cox.

The president’s endorsement “sent a strong signal to Republicans across California that John Cox was their candidate,” Matt Shupe, Cox's communication director, told ABC News in a statement.

A Republican in the general election would all but guarantee the competing Democrat will become the next governor.

Democratic challengers like Villaraigosa have accused Newsom of trying to bolster Cox’s poll numbers by running ads against the Republican, tying Cox to Trump and the NRA, which may push GOP voters to turn out in his favor.

Villaraigosa's campaign did not respond to ABC News' request for comment.

“The ‘top two’ primary forces people to develop these complicated strategies that in another state would seem extremely strange,” Raphael Sonenshein, executive director of the Pat Brown Institute for Public Affairs at California State University, Los Angeles, told KABC. “The real debate in the Democratic Party is whether it would be better for Democratic turnout in the fall, for the house races, to have two Democrats on the ballot or one Democrat and one Republican.”

WATCH LIVE TUESDAY: You can watch livestreaming coverage of all the primary action starting Tuesday at 10 p.m. Eastern/7 p.m. Pacific on ABCNews.com or on the ABC News app available on the Apple App Store, Google Play Store, Apple TV App Store, and Roku Channel Store.

Don’t forget to sign up for Midterm Elections Alerts to get more coverage of this year’s election season from our powerhouse politics team.