Skip to content

Instantly share code, notes, and snippets.

@ta1hia
Created June 22, 2020 19:04
Show Gist options
  • Save ta1hia/2fd39e66d34d400c53885f7caacd77ef to your computer and use it in GitHub Desktop.
Save ta1hia/2fd39e66d34d400c53885f7caacd77ef to your computer and use it in GitHub Desktop.
mochitest instructions

Cross-origin mochitests

Cross-origin (or "xorigin") mode allows for mochitests to be run in a cross origin iframe. Used in conjunction with fission mode, xorigin mode can be used validate site isolation in Firefox.

When cross-origin mode is enabled, the toplevel window runs at "http://mochi.xorigin-test:8888" and individual mochitests are loaded in a cross origin iframe running at "http://mochi.test:8888".

Enabling cross-origin mode

Xorigin mode can be enabled by a flag or environment variable:

./mach mochitest --enable-xorigin-tests [path to test]

 MOZ_XORIGIN_MOCHITEST=1 ./mach mochitest [path to test]

Failing or hanging tests should be annotated at the manifest level using the "xorigin" keyword, for example:

skip-if = xorigin
fail-if = xorigin

Running cross-origin mochitests in Treeherder

TODO

  • currently supported for mochitest-plain jobs
  • will enable on tier2 to start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment