SAN FRANCISCO—The first court trial to test whether “gig economy” workers should be treated as independent contractors or employees got underway Tuesday in what could be seen as the culmination of a series of legal battles that have dogged Silicon Valley.

The trial pits Los Angeles delivery man and struggling actor Raef Lawson against app-based food delivery service GrubHub Inc. The company argues that Lawson is a contractor and therefore not entitled to expense reimbursement and other protections afforded to employees under California labor law. GrubHub is represented by team from Gibson, Dunn & Crutcher, led by partners Theodore Boutrous Jr., Theane Evangelis and Michele Maryott.