results-collection icon indicating copy to clipboard operation
results-collection copied to clipboard

Run Chrome with Mojo test API flags

Open reillyeon opened this issue 8 years ago • 7 comments
trafficstars

The WebUSB tests rely on a polyfill of the WebUSB Testing API that uses the Mojo JavaScript bindings which can be enabled for web content by launching Chrome with the --enable-blink-features=MojoJS,MojoJSTest flag. This flag allows the tests to override Mojo interfaces normally provided by the browser with mocks running within the test itself. This is a pattern used in many Blink LayoutTests and WebUSB is the first API to attempt this in a Web Platform Test. Other browsers may implement the WebUSB Testing API directly or with a similar polyfill. The polyfill approach allows Chrome to support this API without shipping a large amount of bindings code that will not be used outside of Web Platform Tests.

reillyeon avatar Aug 16 '17 16:08 reillyeon

@reillyeon @Hexcles In light of https://github.com/w3c/web-platform-tests/issues/10452, I'm wondering if the desired functionality can also be enabled via --enable-experimental-web-platform-features. Do either of you know?

jugglinmike avatar Apr 12 '18 22:04 jugglinmike

No, this flag is separate from the --enable-experimental-web-platform-features flag.

reillyeon avatar Apr 13 '18 02:04 reillyeon

Got it. Thanks!

jugglinmike avatar Apr 13 '18 02:04 jugglinmike

Is there anything blocking us from adding this flag when running Chrome?

reillyeon avatar Jun 19 '18 14:06 reillyeon

Passing those flags seems to be quite simple. @jugglinmike / @Hexcles are we depending on a bigger decision or can I just send a PR adding the flags to src/master/wpt_run_step.py?

rakuco avatar Jun 25 '18 12:06 rakuco

Ping @foolip WDYT?

At first I didn't like the idea of adding special flags for each browser, but recently I'm not against the idea as much. Firefox uses testing-only prefs. And we already enabled some special flags to Chrome to test WebRTC.

If you're fine with it, I can send a PR to enable the Mojo flags on Chrome dev first.

Hexcles avatar Jul 16 '18 21:07 Hexcles

I'm OK with this. There is still a small problem with the mojo files and code to create the testing APIs being checked into WPT, since actually they evolve together with Chrome and would make sense to release alongside Chrome similar to ChromeDriver. But to even work on fixing that requires enabling this first.

foolip avatar Jul 19 '18 12:07 foolip