Bug 1602668 - M(1) manifest and test changes. r=kmag,karlt,necko-reviewers,valentin
authortkhan <tkhan@mozilla.com>
Mon, 22 Jun 2020 19:09:49 +0000
changeset 536614 110d394581c9faf281580df80bd9bd22bd3f9e0c
parent 536613 fa33ba1a83c022cb410c70c439829f82ca8059a9
child 536615 06349f0f6d61a48f743c0b27554ca45ee71dbfc3
push id37531
push usernbeleuzu@mozilla.com
push dateTue, 23 Jun 2020 03:44:39 +0000
treeherdermozilla-central@b1146cce5053 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskmag, karlt, necko-reviewers, valentin
bugs1602668
milestone79.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1602668 - M(1) manifest and test changes. r=kmag,karlt,necko-reviewers,valentin Differential Revision: https://phabricator.services.mozilla.com/D70362
browser/components/originattributes/test/mochitest/mochitest.ini
browser/components/protocolhandler/test/test_registerHandler.html
browser/components/resistfingerprinting/test/mochitest/mochitest.ini
browser/extensions/formautofill/test/mochitest/creditCard/mochitest.ini
docshell/test/iframesandbox/mochitest.ini
docshell/test/mochitest/mochitest.ini
docshell/test/mochitest/test_forceinheritprincipal_overrule_owner.html
docshell/test/navigation/test_triggeringprincipal_iframe_iframe_window_open.html
docshell/test/navigation/test_triggeringprincipal_parent_iframe_window_open.html
docshell/test/navigation/test_triggeringprincipal_window_open.html
dom/base/test/mochitest.ini
dom/canvas/test/test_imagebitmap.html
dom/credentialmanagement/tests/mochitest/mochitest.ini
dom/events/test/mochitest.ini
dom/events/test/pointerevents/mochitest.ini
dom/html/test/forms/test_formaction_attribute.html
dom/html/test/forms/test_input_typing_sanitization.html
dom/html/test/forms/test_meter_element.html
dom/html/test/forms/test_output_element.html
dom/html/test/forms/test_progress_element.html
dom/html/test/mochitest.ini
dom/html/test/test_allowMedia.html
dom/html/test/test_bug1166138.html
dom/html/test/test_bug209275.xhtml
dom/html/test/test_bug353415-1.html
dom/html/test/test_bug353415-2.html
dom/html/test/test_bug557087-5.html
dom/html/test/test_bug566046.html
dom/html/test/test_bug567938-1.html
dom/html/test/test_bug567938-2.html
dom/html/test/test_bug567938-3.html
dom/html/test/test_bug582412-1.html
dom/html/test/test_bug607145.html
dom/indexedDB/test/mochitest.ini
dom/media/test/mochitest.ini
dom/midi/tests/mochitest.ini
dom/notification/test/mochitest/mochitest.ini
dom/permission/tests/mochitest.ini
dom/plugins/test/mochitest/mochitest.ini
dom/push/test/mochitest.ini
dom/quota/test/mochitest/mochitest.ini
dom/security/featurepolicy/test/mochitest/mochitest.ini
dom/security/test/csp/mochitest.ini
dom/security/test/general/mochitest.ini
dom/security/test/general/test_same_site_cookies_redirect.html
dom/security/test/https-only/mochitest.ini
dom/security/test/mixedcontentblocker/mochitest.ini
dom/security/test/referrer-policy/test_referrer_header_current_document.html
dom/security/test/sri/mochitest.ini
dom/serviceworkers/test/mochitest.ini
dom/tests/mochitest/bugs/mochitest.ini
dom/tests/mochitest/fetch/fetch_test_framework.js
dom/tests/mochitest/fetch/mochitest.ini
dom/tests/mochitest/general/mochitest.ini
dom/tests/mochitest/geolocation/mochitest.ini
dom/tests/mochitest/localstorage/mochitest.ini
dom/tests/mochitest/storageevent/mochitest.ini
dom/u2f/tests/mochitest.ini
dom/url/tests/test_url.html
dom/url/tests/test_urlutils_stringify.html
dom/url/tests/url_worker.js
dom/webauthn/tests/mochitest.ini
dom/workers/test/mochitest.ini
dom/xhr/tests/mochitest.ini
editor/libeditor/tests/mochitest.ini
editor/libeditor/tests/test_nsIEditor_insertLineBreak.html
gfx/layers/apz/test/mochitest/mochitest.ini
image/test/mochitest/test_net_failedtoprocess.html
layout/base/tests/mochitest.ini
layout/generic/test/mochitest.ini
layout/style/test/mochitest.ini
netwerk/test/mochitests/mochitest.ini
parser/htmlparser/tests/mochitest/mochitest.ini
security/manager/ssl/tests/mochitest/mixedcontent/test_bug521461.html
security/manager/ssl/tests/mochitest/mixedcontent/test_dynUnsecurePicture.html
security/manager/ssl/tests/mochitest/mixedcontent/test_innerHtmlDelayedUnsecurePicture.html
security/manager/ssl/tests/mochitest/mixedcontent/test_innerHtmlUnsecurePicture.html
toolkit/components/extensions/test/mochitest/mochitest-common.ini
toolkit/components/passwordmgr/test/mochitest/mochitest.ini
toolkit/components/prompts/test/mochitest.ini
toolkit/components/url-classifier/tests/mochitest/mochitest.ini
toolkit/content/tests/mochitest/mochitest.ini
toolkit/content/tests/widgets/mochitest.ini
--- a/browser/components/originattributes/test/mochitest/mochitest.ini
+++ b/browser/components/originattributes/test/mochitest/mochitest.ini
@@ -1,5 +1,6 @@
 [DEFAULT]
 support-files =
   file_empty.html
 
 [test_permissions_api.html]
+skip-if = xorigin # Hangs
new file mode 100644
--- /dev/null
+++ b/browser/components/protocolhandler/test/test_registerHandler.html
@@ -0,0 +1,88 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=402788
+-->
+<head>
+  <title>Test for Bug 402788</title>
+  <script src="/tests/SimpleTest/SimpleTest.js"></script>
+  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
+</head>
+<body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=402788">Mozilla Bug 402788</a>
+<p id="display"></p>
+<div id="content" style="display: none">
+
+</div>
+<pre id="test">
+<script class="testbody" type="text/javascript">
+
+/** Test for Bug 402788 **/
+  SimpleTest.waitForExplicitFinish();
+
+  // return false if an exception has been catched, true otherwise
+  function testRegisterHandler(aIsProtocol, aTxt, aUri, aTitle) {
+    try {
+      navigator.registerProtocolHandler(aTxt, aUri, aTitle);
+    } catch (e) {
+      return false;
+    }
+
+    return true;
+  }
+
+  // helper function to build URLs since hostname differs 
+  // based on whether the test is running in a cross-origin  iframe
+  function buildUrl(protocol="http", addFormat=true) {
+    return `${protocol}://${window.location.hostname}:${window.location.port}${addFormat ? "/%s" : "/"}`;
+  }
+
+  async function tests() {
+    await SpecialPowers.pushPrefEnv({
+      set: [
+        ["dom.registerProtocolHandler.insecure.enabled", true],
+      ],
+    });
+
+    // testing a generic case
+    is(testRegisterHandler(true, "web+foo", buildUrl(), "Foo handler"), true, "registering a web+foo protocol handler should work");
+
+    // testing with wrong uris
+    is(testRegisterHandler(true, "web+foo", buildUrl("http", false), "Foo handler"), false, "a protocol handler uri should contain %s");
+
+    // the spec explicitly allows relative urls to be passed
+    is(testRegisterHandler(true, "web+foo", "foo/%s", "Foo handler"), true, "a protocol handler uri should be valid");
+
+    // we should only accept to register when the handler has the same host as the current page (bug 402287)
+    is(testRegisterHandler(true, "fweb+oo", "http://remotehost:8888/%s", "Foo handler"), false, "registering a web+foo protocol handler with a different host should not work");
+
+    // restriction to http(s) for the uri of the handler (bug 401343)
+    // http is already tested in the generic case
+    // ftp should not work
+    is(testRegisterHandler(true, "web+foo", buildUrl("ftp"), "Foo handler"), false, "registering a web+foo protocol handler with ftp scheme should not work");
+    // chrome should not work
+    is(testRegisterHandler(true, "web+foo", buildUrl("chrome"), "Foo handler"), false, "registering a web+foo protocol handler with chrome scheme should not work");
+    // foo should not work
+    is(testRegisterHandler(true, "web+foo", buildUrl("foo"), "Foo handler"), false, "registering a web+foo protocol handler with foo scheme should not work");
+
+    // for security reasons, protocol handlers should never be registered for some schemes (chrome, vbscript, ...) (bug 402788)
+    is(testRegisterHandler(true, "chrome", buildUrl(), "chrome handler"), false, "registering a chrome protocol handler should not work");
+    is(testRegisterHandler(true, "vbscript", buildUrl(), "vbscript handler"), false, "registering a vbscript protocol handler should not work");
+    is(testRegisterHandler(true, "javascript", buildUrl(), "javascript handler"), false, "registering a javascript protocol handler should not work");
+    is(testRegisterHandler(true, "moz-icon", buildUrl(), "moz-icon handler"), false, "registering a moz-icon protocol handler should not work");
+
+    // registering anything not on the list of safe schemes and unprefixed by web+ shouldn't work
+    is(testRegisterHandler(true, "foo", buildUrl(), "chrome handler"), false, "registering a foo protocol handler should not work");
+    is(testRegisterHandler(true, "web+", buildUrl(), "chrome handler"), false, "registering a 'web+' protocol handler should not work");
+    is(testRegisterHandler(true, "web+1", buildUrl(), "chrome handler"), false, "registering a 'web+1' protocol handler should not work");
+
+
+    SimpleTest.finish();
+  }
+
+  tests();
+
+</script>
+</pre>
+</body>
+</html>
--- a/browser/components/resistfingerprinting/test/mochitest/mochitest.ini
+++ b/browser/components/resistfingerprinting/test/mochitest/mochitest.ini
@@ -6,16 +6,17 @@ support-files =
   worker_child.js
   worker_grandchild.js
   !/dom/tests/mochitest/geolocation/network_geolocation.sjs
 
 [test_animation_api.html]
 [test_device_sensor_event.html]
 [test_geolocation.html]
 scheme = https
+fail-if = xorigin
 [test_reduce_time_precision.html]
 [test_hide_gamepad_info.html]
 support-files = test_hide_gamepad_info_iframe.html
 [test_keyboard_event.html]
 [test_pointer_event.html]
   support-files =
     ../../../../../dom/events/test/pointerevents/mochitest_support_external.js
 [test_speech_synthesis.html]
--- a/browser/extensions/formautofill/test/mochitest/creditCard/mochitest.ini
+++ b/browser/extensions/formautofill/test/mochitest/creditCard/mochitest.ini
@@ -3,16 +3,17 @@ prefs =
   extensions.formautofill.creditCards.available=true
   extensions.formautofill.reauth.enabled=true
 support-files =
   !/toolkit/components/satchel/test/satchel_common.js
   ../../../../../../toolkit/components/satchel/test/parent_utils.js
   !/toolkit/components/satchel/test/parent_utils.js
   !/browser/extensions/formautofill/test/mochitest/formautofill_common.js
   !/browser/extensions/formautofill/test/mochitest/formautofill_parent_utils.js
+skip-if = xorigin
 
 [test_basic_creditcard_autocomplete_form.html]
 scheme=https
 [test_clear_form.html]
 scheme=https
 [test_creditcard_autocomplete_off.html]
 skip-if = verify
 scheme=https
--- a/docshell/test/iframesandbox/mochitest.ini
+++ b/docshell/test/iframesandbox/mochitest.ini
@@ -16,9 +16,10 @@ skip-if = true # Bug 1455996
 tags = openwindow
 [test_our_auxiliary_navigation_by_location.html]
 tags = openwindow
 [test_parent_navigation_by_location.html]
 tags = openwindow
 [test_sibling_navigation_by_location.html]
 tags = openwindow
 [test_top_navigation_by_location_exotic.html]
+skip-if = xorigin # Assertion failure: parent, at /builds/worker/checkouts/gecko/docshell/base/BrowsingContext.cpp:1624
 [test_top_navigation_by_location.html]
--- a/docshell/test/mochitest/mochitest.ini
+++ b/docshell/test/mochitest/mochitest.ini
@@ -55,16 +55,17 @@ support-files =
 
 [test_anchor_scroll_after_document_open.html]
 [test_bfcache_plus_hash.html]
 [test_bug1422334.html]
 support-files =
   bug1422334_redirect.html
   bug1422334_redirect.html^headers^
   !/docshell/test/navigation/blank.html
+fail-if = xorigin
 [test_bug385434.html]
 [test_bug387979.html]
 [test_bug402210.html]
 [test_bug404548.html]
 [test_bug413310.html]
 skip-if = true
 # Disabled for too many intermittent failures (bug 719186)
 [test_bug475636.html]
--- a/docshell/test/mochitest/test_forceinheritprincipal_overrule_owner.html
+++ b/docshell/test/mochitest/test_forceinheritprincipal_overrule_owner.html
@@ -11,36 +11,42 @@
 var channel = SpecialPowers.wrap(window).docShell.currentDocumentChannel;
 var loadInfo = channel.loadInfo;
 
 // 1) perform some sanity checks
 var triggeringPrincipal = channel.loadInfo.triggeringPrincipal.URI.asciiSpec;
 var loadingPrincipal = channel.loadInfo.loadingPrincipal.URI.asciiSpec;
 var principalToInherit = channel.loadInfo.principalToInherit.URI.asciiSpec;
 
-ok(triggeringPrincipal.startsWith("http://mochi.test:8888/"),
+ok(triggeringPrincipal.startsWith("http://mochi.test:8888/")
+    || triggeringPrincipal.startsWith("http://mochi.xorigin-test:8888/"),
    "initial triggeringPrincipal correct");
-ok(loadingPrincipal.startsWith("http://mochi.test:8888/"),
+ok(loadingPrincipal.startsWith("http://mochi.test:8888/")
+    || loadingPrincipal.startsWith("http://mochi.xorigin-test:8888/"),
    "initial loadingPrincipal correct");
-ok(principalToInherit.startsWith("http://mochi.test:8888/"),
+ok(principalToInherit.startsWith("http://mochi.test:8888/")
+    || principalToInherit.startsWith("http://mochi.xorigin-test:8888/"),
    "initial principalToInherit correct");
 
 // reset principals on the loadinfo
 loadInfo.resetPrincipalToInheritToNullPrincipal();
 
 // 2) verify loadInfo contains the correct principals
 triggeringPrincipal = channel.loadInfo.triggeringPrincipal.URI.asciiSpec;
 loadingPrincipal = channel.loadInfo.loadingPrincipal.URI.asciiSpec;
 principalToInherit = channel.loadInfo.principalToInherit;
 
-ok(triggeringPrincipal.startsWith("http://mochi.test:8888/"),
+ok(triggeringPrincipal.startsWith("http://mochi.test:8888/")
+    || triggeringPrincipal.startsWith("http://mochi.xorigin-test:8888/"),
    "triggeringPrincipal after resetting correct");
-ok(loadingPrincipal.startsWith("http://mochi.test:8888/"),
+ok(loadingPrincipal.startsWith("http://mochi.test:8888/")
+    || loadingPrincipal.startsWith("http://mochi.xorigin-test:8888/"),
    "loadingPrincipal after resetting correct");
-ok(principalToInherit.isNullPrincipal,
+ok(principalToInherit.isNullPrincipal
+    || principalToInherit.startsWith("http://mochi.xorigin-test:8888/"),
    "principalToInherit after resetting correct");
 
 // 3) verify that getChannelResultPrincipal returns right principal
 var resultPrincipal = SpecialPowers.Services.scriptSecurityManager
                                    .getChannelResultPrincipal(channel);
 
 ok(resultPrincipal.isNullPrincipal,
    "resultPrincipal after resetting correct");
--- a/docshell/test/navigation/test_triggeringprincipal_iframe_iframe_window_open.html
+++ b/docshell/test/navigation/test_triggeringprincipal_iframe_iframe_window_open.html
@@ -56,17 +56,17 @@ function checkResults() {
   var loadingPrincipal = channel.loadInfo.loadingPrincipal.URI.asciiSpec;
 
   is(triggeringPrincipal, TRIGGERING_PRINCIPAL_URI,
     "TriggeringPrincipal for targeted window.open() should be the iframe triggering the load");
 
   is(frameA.contentDocument.referrer, TRIGGERING_PRINCIPAL_URI,
     "Referrer for targeted window.open() should be the principal of the iframe triggering the load");
 
-  is(loadingPrincipal, LOADING_PRINCIPAL_URI,
+  is(loadingPrincipal.split("?")[0], LOADING_PRINCIPAL_URI,
     "LoadingPrincipal for targeted window.open() should be the containing document");
 
   SimpleTest.finish();
 }
 
 function performNavigation() {
   frameA.removeEventListener("load", performNavigation);
   frameA.addEventListener("load", checkResults);
--- a/docshell/test/navigation/test_triggeringprincipal_parent_iframe_window_open.html
+++ b/docshell/test/navigation/test_triggeringprincipal_parent_iframe_window_open.html
@@ -33,23 +33,23 @@ const TRIGGERING_PRINCIPAL_URI =
 const LOADING_PRINCIPAL_URI = TRIGGERING_PRINCIPAL_URI;
 
 var testframe = document.getElementById("testframe");
 
 function checkResults() {
   testframe.removeEventListener("load", checkResults);
 
   var channel = SpecialPowers.wrap(testframe.contentWindow).docShell.currentDocumentChannel;
-  var triggeringPrincipal = channel.loadInfo.triggeringPrincipal.URI.asciiSpec;
-  var loadingPrincipal = channel.loadInfo.loadingPrincipal.URI.asciiSpec;
+  var triggeringPrincipal = channel.loadInfo.triggeringPrincipal.URI.asciiSpec.split("?")[0];
+    var loadingPrincipal = channel.loadInfo.loadingPrincipal.URI.asciiSpec.split("?")[0];
 
   is(triggeringPrincipal, TRIGGERING_PRINCIPAL_URI,
     "TriggeringPrincipal for targeted window.open() should be the principal of the document");
 
-  is(testframe.contentDocument.referrer, TRIGGERING_PRINCIPAL_URI,
+  is(testframe.contentDocument.referrer.split("?")[0], TRIGGERING_PRINCIPAL_URI,
     "Referrer for targeted window.open() should be the principal of the document");
 
   is(loadingPrincipal, LOADING_PRINCIPAL_URI,
     "LoadingPrincipal for targeted window.open() should be the <iframe>.ownerDocument");
 
   SimpleTest.finish();
 }
 
--- a/docshell/test/navigation/test_triggeringprincipal_window_open.html
+++ b/docshell/test/navigation/test_triggeringprincipal_window_open.html
@@ -34,20 +34,20 @@ function checkFinish() {
 // ----------------------------------------------------------------------------
 // Test 1: window.open(http:)
 var httpWin = window.open("file_triggeringprincipal_window_open.html", "_blank", "width=10,height=10");
 httpWin.onload = function() {
   var httpChannel = SpecialPowers.wrap(httpWin).docShell.currentDocumentChannel;
   var httpTriggeringPrincipal = httpChannel.loadInfo.triggeringPrincipal.URI.asciiSpec;
   var httpLoadingPrincipal = httpChannel.loadInfo.loadingPrincipal;
 
-  is(httpTriggeringPrincipal, TRIGGERING_PRINCIPAL_URI,
+  is(httpTriggeringPrincipal.split("?")[0], TRIGGERING_PRINCIPAL_URI,
      "TriggeringPrincipal for window.open(http:) should be the principal of the document");
 
-  is(httpWin.document.referrer, TRIGGERING_PRINCIPAL_URI,
+  is(httpWin.document.referrer.split("?")[0], TRIGGERING_PRINCIPAL_URI,
      "Referrer for window.open(http:) should be the principal of the document");
 
   is(httpLoadingPrincipal, null,
      "LoadingPrincipal for window.open(http:) should be null");
 
   httpWin.close();
   checkFinish();
 };
@@ -55,17 +55,17 @@ httpWin.onload = function() {
 // ----------------------------------------------------------------------------
 // Test 2: window.open(javascript:)
 var jsWin = window.open("javascript:'<html><body>js</body></html>';", "_blank", "width=10,height=10");
 jsWin.onload = function() {
   var jsChannel = SpecialPowers.wrap(jsWin).docShell.currentDocumentChannel;
   var jsTriggeringPrincipal = jsChannel.loadInfo.triggeringPrincipal.URI.asciiSpec;
   var jsLoadingPrincipal = jsChannel.loadInfo.loadingPrincipal;
 
-  is(jsTriggeringPrincipal, TRIGGERING_PRINCIPAL_URI,
+  is(jsTriggeringPrincipal.split("?")[0], TRIGGERING_PRINCIPAL_URI,
      "TriggeringPrincipal for window.open(javascript:) should be the principal of the document");
 
   is(jsWin.document.referrer, "",
      "Referrer for window.open(javascript:) should be empty");
 
   is(jsLoadingPrincipal, null,
      "LoadingPrincipal for window.open(javascript:) should be null");
 
--- a/dom/base/test/mochitest.ini
+++ b/dom/base/test/mochitest.ini
@@ -352,16 +352,17 @@ support-files = file_bug357450.js
 [test_bug371576-3.html]
 [test_bug371576-4.html]
 [test_bug371576-5.html]
 [test_bug372086.html]
 [test_bug372964-2.html]
 [test_bug372964.html]
 [test_bug373181.xhtml]
 [test_bug375314.html]
+skip-if = xorigin # Hangs
 [test_bug375314-2.html]
 [test_bug378969.html]
 [test_bug380418.html]
 support-files = test_bug380418.html^headers^
 [test_bug382113.html]
 [test_bug382871.html]
 [test_bug384003.xhtml]
 [test_bug390219.html]
@@ -575,32 +576,34 @@ skip-if = (verify && !debug && (os == 'l
 [test_bug876282.html]
 [test_bug891952.html]
 [test_bug894874.html]
 [test_bug895974.html]
 [test_bug907892.html]
 [test_bug913761.html]
 [test_bug922681.html]
 [test_bug927196.html]
+fail-if = xorigin
 [test_bug962251.html]
 [test_bug976673.html]
 skip-if = fission #Bug 1613899
 [test_bug982153.html]
 [test_bug999456.html]
 [test_bug1022229.html]
 [test_bug1025933.html]
 [test_bug1037687.html]
 support-files = test_bug1037687_subframe.html
 [test_bug1043106.html]
 [test_bug1057176.html]
 [test_bug1060938.html]
 [test_bug1064481.html]
 [test_bug1070015.html]
 [test_bug1075702.html]
 [test_bug1091883.html]
+fail-if = xorigin
 [test_bug1100912.html]
 support-files = file_bug1100912.html
 [test_bug1101364.html]
 [test_bug1118689.html]
 [test_bug1126851.html]
 [test_bug1163743.html]
 [test_bug1165501.html]
 [test_bug1187157.html]
@@ -771,16 +774,17 @@ support-files = file_location_href_unkno
 tags = audiochannel
 [test_noAudioNotificationOnMutedElement.html]
 tags = audiochannel
 [test_noAudioNotificationOnMutedOrVolume0Element.html]
 tags = audiochannel
 [test_noAudioNotificationOnVolume0Element.html]
 tags = audiochannel
 [test_NodeIterator_basics_filters.xhtml]
+skip-if = xorigin
 [test_NodeIterator_mutations_1.xhtml]
 [test_NodeIterator_mutations_2.html]
 [test_NodeIterator_mutations_3.html]
 [test_nodelist_holes.html]
 [test_noWebAudioNotification.html]
 tags = audiochannel
 [test_open_null_features.html]
 [test_openDialogChromeOnly.html]
@@ -788,19 +792,21 @@ tags = openwindow
 [test_pdf_print.html]
 skip-if = toolkit == 'android' # We don't ship pdf.js on Android
 [test_plugin_freezing.html]
 skip-if = (os == 'win' && processor == 'aarch64')
 reason = Plugins are not supported on Windows/AArch64
 [test_pluginAudioNotification.html]
 tags = audiochannel
 skip-if = toolkit == 'android' # Plugins don't work on Android
+  || xorigin # Hangs
 [test_pluginMutedBeforePlay.html]
 tags = audiochannel
 skip-if = toolkit == 'android' # Plugins don't work on Android
+  || xorigin # JavaScript error: http://mochi.xorigin-test:8888/tests/SimpleTest/TestRunner.js, line 157: SecurityError: Permission denied to access property "wrappedJSObject" on cross-origin object, JavaScript error: /builds/worker/workspace/build/tests/bin/components/httpd.js, line 3824: NS_ERROR_NOT_AVAILABLE:
 [test_postMessage_solidus.html]
 [test_postMessages_window.html]
 [test_postMessages_workers.html]
 [test_postMessages_broadcastChannel.html]
 [test_postMessages_messagePort.html]
 [test_postMessage_originAttributes.html]
 support-files = file_receiveMessage.html
 skip-if = true # Uses mismatched OriginAttributes for iframe (bug 1616353)
@@ -871,10 +877,11 @@ fail-if = fission
 [test_window_indexing.html]
 [test_window_keys.html]
 [test_window_named_frame_enumeration.html]
 [test_window_own_props.html]
 [test_window_proto.html]
 [test_writable-replaceable.html]
 [test_x-frame-options.html]
 skip-if = toolkit == 'android' && debug && !is_fennec
+  || xorigin # JavaScript error: http://mochi.test:8888/tests/dom/base/test/test_x-frame-options.html, line 48: TypeError: can't access property "textContent", this.content.document.getElementById(...) is null, JavaScript error: resource://gre/modules/ProcessSelector.jsm, line 56: TypeError: can't access property "tabCount", process is null
 [test_youtube_flash_embed.html]
 # Please keep alphabetical order.
--- a/dom/canvas/test/test_imagebitmap.html
+++ b/dom/canvas/test/test_imagebitmap.html
@@ -274,20 +274,20 @@ function testSecurityErrors() {
       ok(!!imageBitmap, "ImageBitmaps are always created");
       const context = document.createElement("canvas").getContext("2d");
       context.drawImage(imageBitmap, 0, 0);
       try {
         context.getImageData(0, 0, 1, 1);
         ok(false, "Did not get SecurityError with unclean source. ImageBitmap was created successfully.");
       } catch (ex) {
         if (ex == "SecurityError: The operation is insecure.") {
-          ok(true, ex);
+          ok(true, ex.message);
         }
         else {
-          ok(false, "Did not get SecurityError with unclean source. Error Message: " + ex);
+          ok(false, "Did not get SecurityError with unclean source. Error Message: " + ex.message);
         }
       }
     });
   }
 
   return Promise.all([
     checkPromiseFailedWithSecurityError(getUncleanImagePromise()),
     checkPromiseFailedWithSecurityError(getUncleanVideoPromise()),
--- a/dom/credentialmanagement/tests/mochitest/mochitest.ini
+++ b/dom/credentialmanagement/tests/mochitest/mochitest.ini
@@ -1,7 +1,8 @@
 [DEFAULT]
 support-files =
   frame_credman_iframes.html
 scheme = https
 skip-if = !e10s
 
 [test_credman_iframes.html]
+skip-if = xorigin  # Application time out
--- a/dom/events/test/mochitest.ini
+++ b/dom/events/test/mochitest.ini
@@ -23,43 +23,46 @@ support-files =
 
 [test_accel_virtual_modifier.html]
 [test_addEventListenerExtraArg.html]
 [test_all_synthetic_events.html]
 [test_bug1518442.html]
 [test_bug1539497.html]
 [test_bug226361.xhtml]
 [test_bug238987.html]
+fail-if = xorigin
 [test_bug288392.html]
 [test_bug299673-1.html]
 [test_bug1037990.html]
 [test_bug299673-2.html]
 [test_bug322588.html]
 [test_bug328885.html]
 [test_bug336682_1.html]
 support-files = test_bug336682.js
 [test_bug367781.html]
 [test_bug379120.html]
 [test_bug402089.html]
 [test_bug405632.html]
 [test_bug409604.html]
 skip-if = toolkit == 'android' #TIMED_OUT
+  || xorigin # Inconsistent pass/fail in opt and debug
 [test_bug412567.html]
 [test_bug418986-3.html]
 [test_bug422132.html]
 [test_bug426082.html]
 [test_bug427537.html]
 [test_bug428988.html]
 [test_bug432698.html]
 [test_bug443985.html]
 skip-if = verify
 [test_bug447736.html]
 [test_bug448602.html]
 [test_bug450876.html]
 skip-if = verify
+fail-if = xorigin
 [test_bug456273.html]
 [test_bug457672.html]
 skip-if = toolkit == 'android' #CRASH_DUMP, RANDOM
 [test_bug489671.html]
 [test_bug493251.html]
 [test_bug508479.html]
 skip-if = toolkit == 'android' #CRASH_DUMP, RANDOM # drag event fails
 [test_bug517851.html]
@@ -129,16 +132,17 @@ skip-if = debug #In order to be able to 
 [test_bug864040.html]
 [test_bug924087.html]
 [test_bug930374-content.html]
 [test_bug944011.html]
 [test_bug944847.html]
 [test_bug946632.html]
 [test_bug967796.html]
 skip-if = (verify && (os == 'linux'))
+  || xorigin # JavaScript error: http://mochi.xorigin-test:8888/tests/SimpleTest/TestRunner.js, line 157: SecurityError: Permission denied to access property "wrappedJSObject" on cross-origin object
 [test_bug985988.html]
 [test_bug998809.html]
 [test_bug1003432.html]
 support-files = test_bug1003432.js
 [test_bug1013412.html]
 skip-if = (verify && debug && (os == 'linux' || os == 'win'))
 [test_bug1017086_disable.html]
 support-files = bug1017086_inner.html
--- a/dom/events/test/pointerevents/mochitest.ini
+++ b/dom/events/test/pointerevents/mochitest.ini
@@ -75,29 +75,31 @@ support-files = pointerevent_releasepoin
 [test_pointerevent_releasepointercapture_onpointerup_mouse-manual.html]
 support-files = pointerevent_releasepointercapture_onpointerup_mouse-manual.html
 [test_pointerevent_releasepointercapture_release_right_after_capture-manual.html]
 support-files = pointerevent_releasepointercapture_release_right_after_capture-manual.html
 [test_pointerevent_sequence_at_implicit_release_on_drag-manual.html]
 support-files = pointerevent_sequence_at_implicit_release_on_drag-manual.html
 [test_pointerevent_setpointercapture_inactive_button_mouse-manual.html]
 support-files = pointerevent_setpointercapture_inactive_button_mouse-manual.html
-skip-if = (verify && (os == 'linux' || os == 'mac'))
+skip-if = verify && (os == 'linux' || os == 'mac')
+  || xorigin # JavaScript error: http://mochi.test:8888/tests/dom/events/test/pointerevents/pointerevent_setpointercapture_inactive_button_mouse-manual.html, line 35: InvalidPointerId: Invalid pointer id.
 [test_pointerevent_setpointercapture_invalid_pointerid-manual.html]
 support-files = pointerevent_setpointercapture_invalid_pointerid-manual.html
 [test_pointerevent_setpointercapture_override_pending_capture_element-manual.html]
 support-files = pointerevent_setpointercapture_override_pending_capture_element-manual.html
 [test_pointerevent_setpointercapture_to_same_element_twice-manual.html]
 support-files = pointerevent_setpointercapture_to_same_element_twice-manual.html
 [test_pointerevent_suppress_compat_events_on_click-manual.html]
 support-files = pointerevent_suppress_compat_events_on_click-manual.html
 [test_pointerevent_suppress_compat_events_on_drag_mouse-manual.html]
 support-files = pointerevent_suppress_compat_events_on_drag_mouse-manual.html
 [test_touch_action.html]
 skip-if = os == 'android' # Bug 1312791
+  || xorigin # JavaScript error: http://mochi.xorigin-test:8888/tests/SimpleTest/TestRunner.js, line 157: SecurityError: Permission denied to access property "wrappedJSObject" on cross-origin object
 support-files =
   ../../../../gfx/layers/apz/test/mochitest/apz_test_utils.js
   ../../../../gfx/layers/apz/test/mochitest/apz_test_native_event_utils.js
   touch_action_helpers.js
   pointerevent_touch-action-auto-css_touch-manual.html
   pointerevent_touch-action-button-test_touch-manual.html
   pointerevent_touch-action-inherit_child-auto-child-none_touch-manual.html
   pointerevent_touch-action-inherit_child-none_touch-manual.html
--- a/dom/html/test/forms/test_formaction_attribute.html
+++ b/dom/html/test/forms/test_formaction_attribute.html
@@ -65,17 +65,17 @@ https://bugzilla.mozilla.org/show_bug.cg
 <pre id="test">
 <script type="application/javascript">
 
 /** Test for Bug 566160 **/
 
 SimpleTest.waitForExplicitFinish();
 SimpleTest.waitForFocus(runTests);
 
-const BASE_URI = "http://mochi.test:8888/tests/dom/html/test/forms/PASS.html";
+const BASE_URI = `${location.origin}/tests/dom/html/test/forms/PASS.html`;
 var gTestResults = {
   frame1: BASE_URI + "?foo=foo",
   frame2: BASE_URI + "?bar=bar&x=0&y=0",
   frame3: BASE_URI + "?tulip=tulip",
   frame3bis: BASE_URI + "?tulipbis=tulipbis",
   frame4: BASE_URI + "?footulip=footulip",
   frame5: BASE_URI + "?foobar=foobar&x=0&y=0",
   frame6: BASE_URI + "?tulip2=tulip2",
--- a/dom/html/test/forms/test_input_typing_sanitization.html
+++ b/dom/html/test/forms/test_input_typing_sanitization.html
@@ -52,18 +52,17 @@ function runTestsForNextInputType()
   if (done) {
     SimpleTest.finish();
   }
 }
 
 function checkValueSubmittedIsValid()
 {
   is(frames.submit_frame.location.href,
-     'http://mochi.test:8888/tests/dom/html/test/forms/foo?i='
-     + urlify(gValidData[valueIndex++]),
+     `${location.origin}/tests/dom/html/test/forms/foo?i=${urlify(gValidData[valueIndex++])}`,
      "The submitted value should not have been sanitized");
 
   input.value = "";
 
   if (valueIndex >= gValidData.length) {
     if (gCurrentTest.canHaveBadInputValidityState) {
       // Don't run the submission tests on the invalid input if submission
       // will be blocked by invalid input.
@@ -75,17 +74,17 @@ function checkValueSubmittedIsValid()
     testData = gInvalidData;
   }
   testSubmissions();
 }
 
 function checkValueSubmittedIsInvalid()
 {
   is(frames.submit_frame.location.href,
-     'http://mochi.test:8888/tests/dom/html/test/forms/foo?i=',
+     `${location.origin}/tests/dom/html/test/forms/foo?i=`,
      "The submitted value should have been sanitized");
 
   valueIndex++;
   input.value = "";
 
   if (valueIndex >= gInvalidData.length) {
     if (submitMethod == sendKeyEventToSubmitForm) {
       runTestsForNextInputType();
--- a/dom/html/test/forms/test_meter_element.html
+++ b/dom/html/test/forms/test_meter_element.html
@@ -307,17 +307,17 @@ function checkNotResetableAndFormSubmiss
   form.appendChild(input);
 
   // Setting values.
   aElement.value = 42.0;
   aElement.max = 100.0;
 
   document.getElementsByName('submit_frame')[0].addEventListener("load", function() {
     is(frames.submit_frame.location.href,
-      'http://mochi.test:8888/tests/dom/html/test/forms/foo?a=tulip',
+      `${location.origin}/tests/dom/html/test/forms/foo?a=tulip`,
        "The meter element value should not be submitted");
 
     checkNotResetable();
   }, {once: true});
 
   form.submit();
 }
 
--- a/dom/html/test/forms/test_output_element.html
+++ b/dom/html/test/forms/test_output_element.html
@@ -131,17 +131,17 @@ function checkFormSubmission()
 {
   /**
    * All elements values have been set just before the submission.
    * The input elements values should be in the submit url but the ouput
    * element value should not appear.
    */
 
   is(frames.submit_frame.location.href,
-    'http://mochi.test:8888/tests/dom/html/test/forms/foo?a=afield&b=bfield',
+    `${location.origin}/tests/dom/html/test/forms/foo?a=afield&b=bfield`,
      "The output element value should not be submitted");
   SimpleTest.finish();
 }
 
 SimpleTest.waitForExplicitFinish();
 addLoadEvent(function() {
   reflectString({
     element: document.createElement("output"),
--- a/dom/html/test/forms/test_progress_element.html
+++ b/dom/html/test/forms/test_progress_element.html
@@ -243,17 +243,17 @@ function checkNotResetableAndFormSubmiss
   form.appendChild(input);
 
   // Setting values.
   aElement.value = 42.0;
   aElement.max = 100.0;
 
   document.getElementsByName('submit_frame')[0].addEventListener("load", function() {
     is(frames.submit_frame.location.href,
-      'http://mochi.test:8888/tests/dom/html/test/forms/foo?a=tulip',
+      `${location.origin}/tests/dom/html/test/forms/foo?a=tulip`,
        "The progress element value should not be submitted");
 
     checkNotResetable();
   }, {once: true});
 
   form.submit();
 }
 
--- a/dom/html/test/mochitest.ini
+++ b/dom/html/test/mochitest.ini
@@ -330,38 +330,41 @@ skip-if = toolkit == 'android' #TIMED_OU
 [test_bug600155.html]
 [test_bug601030.html]
 [test_bug605124-1.html]
 [test_bug605124-2.html]
 [test_bug605125-1.html]
 [test_bug605125-2.html]
 [test_bug606817.html]
 [test_bug607145.html]
+fail-if = xorigin
 [test_bug610212.html]
 [test_bug610687.html]
 [test_bug611189.html]
 [test_bug612730.html]
 skip-if = toolkit == 'android' # form control not selected/checked with synthesizeMouse
 [test_bug613113.html]
 [test_bug613019.html]
 [test_bug613722.html]
 [test_bug613979.html]
 [test_bug615595.html]
+fail-if = xorigin
 [test_bug615833.html]
 skip-if = toolkit == 'android' || os == 'mac' #TIMED_OUT # form control not selected/checked with synthesizeMouse, osx(bug 1275664)
 [test_bug617528.html]
 [test_bug618948.html]
 [test_bug619278.html]
 [test_bug622558.html]
 [test_bug622597.html]
 [test_bug623291.html]
 [test_bug6296.html]
 [test_bug629801.html]
 [test_bug633058.html]
 [test_bug636336.html]
+fail-if = xorigin
 [test_bug641219.html]
 [test_bug643051.html]
 [test_bug646157.html]
 [test_bug649134.html]
 # This extra subdirectory is needed due to the nature of this test.
 # With the bug, the test loads the base URL of the bug649134/file_*.sjs
 # files, and the mochitest server responds with the contents of index.html if
 # it exists in that case, which we use to detect failure.
@@ -510,16 +513,17 @@ skip-if = (toolkit == 'android') || ((os
 [test_ol_attributes_reflection.html]
 [test_option_defaultSelected.html]
 [test_option_selected_state.html]
 [test_param_attributes_reflection.html]
 [test_q_attributes_reflection.html]
 [test_restore_from_parser_fragment.html]
 [test_rowscollection.html]
 [test_srcdoc-2.html]
+skip-if = xorigin # JavaScript error: http://mochi.xorigin-test:8888/tests/SimpleTest/TestRunner.js, line 157: SecurityError: Permission denied to access property "wrappedJSObject" on cross-origin object
 [test_srcdoc.html]
 [test_style_attributes_reflection.html]
 [test_track.html]
 [test_ul_attributes_reflection.html]
 [test_input_files_not_nsIFile.html]
 [test_fragment_form_pointer.html]
 [test_bug1682.html]
 [test_bug1823.html]
--- a/dom/html/test/test_allowMedia.html
+++ b/dom/html/test/test_allowMedia.html
@@ -10,17 +10,17 @@ https://bugzilla.mozilla.org/show_bug.cg
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
   <script type="application/javascript">
 
   /** Test for Bug 759964 **/
 
 SimpleTest.waitForExplicitFinish();
 addLoadEvent(runNextTest);
 
-var SJS = "http://mochi.test:8888/tests/dom/html/test/allowMedia.sjs";
+var SJS = `${location.origin}/tests/dom/html/test/allowMedia.sjs`;
 var TEST_PAGE = "data:text/html,<audio src='" + SJS + "?audio'></audio>";
 
 function runNextTest() {
   var test = tests.shift();
   if (!test) {
     SimpleTest.finish();
     return;
   }
--- a/dom/html/test/test_bug1166138.html
+++ b/dom/html/test/test_bug1166138.html
@@ -11,19 +11,19 @@ https://bugzilla.mozilla.org/show_bug.cg
 </head>
 <body>
   <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1166138">Mozilla Bug 1166138</a>
   <p id="display"></p>
   <div id="content" style="display: none">
   </div>
 
   <script type="application/javascript">
-    var img1x = "http://mochi.test:8888/tests/dom/html/test/file_bug1166138_1x.png";
-    var img2x = "http://mochi.test:8888/tests/dom/html/test/file_bug1166138_2x.png";
-    var imgdef = "http://mochi.test:8888/tests/dom/html/test/file_bug1166138_def.png";
+    var img1x = `${location.origin}/tests/dom/html/test/file_bug1166138_1x.png`;
+    var img2x = `${location.origin}/tests/dom/html/test/file_bug1166138_2x.png`;
+    var imgdef = `${location.origin}/tests/dom/html/test/file_bug1166138_def.png`;
     var onLoadCallback = null;
     var done = false;
 
     var startPromise = new Promise((a) => {
       onLoadCallback = () => {
         var image = document.querySelector('img');
         // If we aren't starting at 2x scale, resize to 2x scale, and wait for a load
         if (image.currentSrc != img2x) {
--- a/dom/html/test/test_bug209275.xhtml
+++ b/dom/html/test/test_bug209275.xhtml
@@ -123,17 +123,17 @@ function* run() {
   // Load http://example.com/${rand} into a new window so we can test that
   // changing the document's base changes the visitedness of our links.
   //
   // cross-origin window.open'd windows don't fire load / error events, so we
   // wait to close it until we observed the visited color.
   let win = window.open("http://example.com/" + rand, "_blank");
 
   // Make sure things are what as we expect them at the beginning.
-  link123HrefIs("http://mochi.test:8888/", 1);
+  link123HrefIs(`${location.origin}/`, 1);
   is($('link4').href, loc + "#", "link 4 test 1");
   is($('link5').href, loc + "#", "link 5 test 1");
 
   // Remove link5 from the document.  We're going to test that its href changes
   // properly when we change our base.
   var link5 = $('link5');
   link5.remove();
 
@@ -161,23 +161,23 @@ function* run() {
           "Wrong ellipse fill after base change.");
 
   win.close();
 
   $('base1').href = "foo/";
   // Should be interpreted relative to current URI (not the current base), so
   // base should now be http://mochi.test:8888/foo/
 
-  link123HrefIs("http://mochi.test:8888/", 3);
+  link123HrefIs(`${location.origin}/`, 3);
   is($('link4').href, path + "foo/#", "link 4 test 3");
 
   // Changing base2 shouldn't affect anything, because it's not the first base
   // tag.
   $('base2').href = "http://example.org/bar/";
-  link123HrefIs("http://mochi.test:8888/", 4);
+  link123HrefIs(`${location.origin}/`, 4);
   is($('link4').href, path + "foo/#", "link 4 test 4");
 
   // If we unset base1's href attribute, the document's base should come from
   // base2, whose href is http://example.org/bar/.
   $('base1').removeAttribute("href");
   link123HrefIs("http://example.org/", 5);
   is($('link4').href, "http://example.org/bar/#", "link 4 test 5");
 
@@ -203,23 +203,23 @@ function* run() {
   is($('link4').href, "http://base4.example.org/#", "link 4 test 8");
 
   // Now if we remove all the base tags, the base should become the page's URI
   // again.
   $('base2').remove();
   base3.remove();
   base4.remove();
 
-  link123HrefIs("http://mochi.test:8888/", 9);
+  link123HrefIs(`${location.origin}/`, 9);
   is($('link4').href, loc + "#", "link 4 test 9");
 
   // Setting the href of base0 shouldn't do anything because it's not in the
   // XHTML namespace.
   $('base0').href = "http://bar.com";
-  link123HrefIs("http://mochi.test:8888/", 10);
+  link123HrefIs(`${location.origin}/`, 10);
   is($('link4').href, loc + "#", "link 4 test 10");
 
   // We load into an iframe a document with a <base href="...">, then remove
   // the document element.  Then we add an <html>, <body>, and <a>, and make
   // sure that the <a> is resolved relative to the page's location, not its
   // original base.  We do this twice, rebuilding the document in a different
   // way each time.
 
@@ -227,17 +227,17 @@ function* run() {
   yield undefined; // wait for our child to call us back.
   is(iframeCw.document.getElementById("link").href,
      path + "file_bug209275_1.html#",
      "Wrong href after nuking document.");
 
   iframeCw.location = "file_bug209275_2.html";
   yield undefined; // wait for callback from child
   is(iframeCw.document.getElementById("link").href,
-     "http://mochi.test:8888/",
+     `${location.origin}/`,
      "Wrong href after nuking document second time.");
 
   // Make sure that document.open() makes the document forget about any <base>
   // tags it has.
   iframeCw.location = "file_bug209275_3.html";
   yield undefined; // wait for callback from child
   is(iframeCw.document.getElementById("link").href,
      "http://mochi.test:8888/",
--- a/dom/html/test/test_bug353415-1.html
+++ b/dom/html/test/test_bug353415-1.html
@@ -26,17 +26,17 @@
 <input name="field12">
 <input type="button" name="field13" value="button">
 </form>
 <script>
   SimpleTest.waitForExplicitFinish();
 
   addLoadEvent(function() {
     document.getElementsByName('submit_frame')[0].onload = function() {
-      is(frames.submit_frame.location.href, "http://mochi.test:8888/blah?field1=teststring&field2=0&field4=1&field6=3&field7=2&field8=8&field9=9&field12=", "Submit string was correct.");
+      is(frames.submit_frame.location.href, `${location.origin}/blah?field1=teststring&field2=0&field4=1&field6=3&field7=2&field8=8&field9=9&field12=`, "Submit string was correct.");
       SimpleTest.finish();
     };
 
     document.forms[0].submit();
   });
 </script>
 </body>
 </html>
--- a/dom/html/test/test_bug353415-2.html
+++ b/dom/html/test/test_bug353415-2.html
@@ -51,17 +51,17 @@
 </tr>
 </table>
 </form>
 <script>
   SimpleTest.waitForExplicitFinish();
 
   addLoadEvent(function() {
     document.getElementsByName('submit_frame')[0].onload = function() {
-      is(frames.submit_frame.location.href, "http://mochi.test:8888/blah?field1-2=teststring&field2-2=0&field4-2=1&field6-2=3&field7-2=2&field8-2=8&field9-2=9&field12-2=&field1=teststring&field2=0&field4=1&field6=3&field7=2&field8=8&field9=9&field12=&field14=14&field14-2=14", "Submit string was correct.");
+      is(frames.submit_frame.location.href, `${location.origin}/blah?field1-2=teststring&field2-2=0&field4-2=1&field6-2=3&field7-2=2&field8-2=8&field9-2=9&field12-2=&field1=teststring&field2=0&field4=1&field6=3&field7=2&field8=8&field9=9&field12=&field14=14&field14-2=14`, "Submit string was correct.");
       SimpleTest.finish();
     };
 
     document.forms[0].submit();
   });
 </script>
 </body>
 </html>
--- a/dom/html/test/test_bug557087-5.html
+++ b/dom/html/test/test_bug557087-5.html
@@ -26,17 +26,17 @@ https://bugzilla.mozilla.org/show_bug.cg
 <pre id="test">
 <script type="application/javascript">
 
 /** Test for Bug 557087 **/
 
 SimpleTest.waitForExplicitFinish();
 addLoadEvent(runTest);
 
-const BASE_URI = "http://mochi.test:8888/tests/dom/html/test/dummy_page.html";
+const BASE_URI = `${location.origin}/tests/dom/html/test/dummy_page.html`;
 var testResults = [
   BASE_URI + "?",
   BASE_URI + "?",
   BASE_URI + "?i=i&t=t&s=s",
   BASE_URI + "?i=i&t=t&s=s",
 ];
 var gTestCount = 0;
 
--- a/dom/html/test/test_bug566046.html
+++ b/dom/html/test/test_bug566046.html
@@ -80,17 +80,17 @@ https://bugzilla.mozilla.org/show_bug.cg
 
 /** Test for Bug 566046 **/
 
 SimpleTest.waitForExplicitFinish();
 addLoadEvent(function() {
   setTimeout(runTests, 0);
 });
 
-const BASE_URI = "http://mochi.test:8888/tests/dom/html/test/dummy_page.html";
+const BASE_URI = `${location.origin}/tests/dom/html/test/dummy_page.html`;
 var gTestResults = {
   frame1: BASE_URI + "?foo=foo",
   frame2: BASE_URI + "?bar=bar",
   frame3: BASE_URI + "?tulip=tulip",
   frame4: BASE_URI + "?foobar=foobar&x=0&y=0",
   frame5: BASE_URI + "?tulip2=tulip2",
   frame5bis: BASE_URI + "?tulip3=tulip3",
   frame6: BASE_URI + "?footulip=footulip",
--- a/dom/html/test/test_bug567938-1.html
+++ b/dom/html/test/test_bug567938-1.html
@@ -44,17 +44,17 @@ function initializeNextTest()
 
   sendMouseEvent({type: 'click'}, 'i');
 }
 
 function runTests()
 {
   document.getElementById('iframe').addEventListener('load', function(aEvent) {
     is(frames.submit_frame.location.href,
-       "http://mochi.test:8888/tests/dom/html/test/" + gTestData[gCurrentTest] + "?",
+       `${location.origin}/tests/dom/html/test/${gTestData[gCurrentTest]}?`,
        "The form should have been submitted");
     gCurrentTest++;
     if (gCurrentTest < gTestData.length) {
       initializeNextTest();
     } else {
       aEvent.target.removeEventListener('load', arguments.callee);
       SimpleTest.finish();
     }
--- a/dom/html/test/test_bug567938-2.html
+++ b/dom/html/test/test_bug567938-2.html
@@ -45,17 +45,17 @@ function initializeNextTest()
 
   sendMouseEvent({type: 'click'}, 'i');
 }
 
 function runTests()
 {
   document.getElementById('iframe').addEventListener('load', function(aEvent) {
     is(frames.submit_frame.location.href,
-       "http://mochi.test:8888/tests/dom/html/test/" + gTestData[gCurrentTest] + "?",
+       `${location.origin}/tests/dom/html/test/${gTestData[gCurrentTest]}?`,
        "The form should have been submitted");
     gCurrentTest++;
     if (gCurrentTest < gTestData.length) {
       initializeNextTest();
     } else {
       aEvent.target.removeEventListener('load', arguments.callee);
       SimpleTest.finish();
     }
--- a/dom/html/test/test_bug567938-3.html
+++ b/dom/html/test/test_bug567938-3.html
@@ -45,17 +45,17 @@ function initializeNextTest()
 
   sendMouseEvent({type: 'click'}, 'i');
 }
 
 function runTests()
 {
   document.getElementById('iframe').addEventListener('load', function(aEvent) {
     is(frames.submit_frame.location.href,
-       "http://mochi.test:8888/tests/dom/html/test/" + gTestData[gCurrentTest] + "?",
+      `${location.origin}/tests/dom/html/test/${gTestData[gCurrentTest]}?`,
        "The form should have been submitted");
     gCurrentTest++;
     if (gCurrentTest < gTestData.length) {
       initializeNextTest();
     } else {
       aEvent.target.removeEventListener('load', arguments.callee);
       SimpleTest.finish();
     }
--- a/dom/html/test/test_bug582412-1.html
+++ b/dom/html/test/test_bug582412-1.html
@@ -82,17 +82,17 @@ https://bugzilla.mozilla.org/show_bug.cg
 
 /** Test for Bug 566160 **/
 
 SimpleTest.waitForExplicitFinish();
 addLoadEvent(function() {
   setTimeout(runTests, 0);
 });
 
-const BASE_URI = "http://mochi.test:8888/tests/dom/html/test/dummy_page.html";
+const BASE_URI = `${location.origin}/tests/dom/html/test/dummy_page.html`;
 var gTestResults = {
   frame1: BASE_URI + "?foo=foo",
   frame2: BASE_URI + "?bar=bar&x=0&y=0",
   frame3: BASE_URI + "?tulip=tulip",
   frame3bis: BASE_URI + "?tulipbis=tulipbis",
   frame4: BASE_URI + "?footulip=footulip",
   frame5: BASE_URI + "?foobar=foobar&x=0&y=0",
   frame6: BASE_URI + "?tulip2=tulip2",
--- a/dom/html/test/test_bug607145.html
+++ b/dom/html/test/test_bug607145.html
@@ -33,17 +33,17 @@ function reflectURL(aElement, aAttr)
 
   var previousDir = location.href.replace(/test\/[^\/]*$/, "");
   var dir = location.href.replace(/test_bug607145.html[^\/]*$/, "");
   var doc = location.href.replace(/\.html.*/, ".html");
 
   ok(idl in aElement, idl + " should be available in " + elmtName);
 
   // Default values.
-  is(aElement[idl], doc, "." + idl + " default value should be the document's URL");
+  is(aElement[idl].split("?")[0], doc, "." + idl + " default value should be the document's URL");
   is(aElement.getAttribute(attr), null,
      "@" + attr + " default value should be null");
 
   var values = [
     /* value to set, resolved value */
     [ "foo.html", dir + "foo.html" ],
     [ "data:text/html,<html></html>", "data:text/html,<html></html>" ],
     [ "http://example.org/", "http://example.org/" ],
--- a/dom/indexedDB/test/mochitest.ini
+++ b/dom/indexedDB/test/mochitest.ini
@@ -212,32 +212,35 @@ skip-if = toolkit == 'android' && !is_fe
 skip-if = true
 [test_key_requirements.html]
 [test_keys.html]
 [test_leaving_page.html]
 [test_maximal_serialized_object_size.html]
 [test_message_manager_ipc.html]
 [test_multientry.html]
 [test_names_sorted.html]
+skip-if = (xorigin && !debug) # Hangs
 [test_objectCursors.html]
 [test_objectStore_getAllKeys.html]
 [test_objectStore_inline_autoincrement_key_added_on_put.html]
 [test_objectStore_openKeyCursor.html]
 [test_objectStore_remove_values.html]
 [test_object_identity.html]
 [test_odd_result_order.html]
 [test_open_empty_db.html]
 [test_open_for_principal.html]
 [test_open_objectStore.html]
+skip-if = xorigin # JavaScript error: http://mochi.xorigin-test:8888/tests/SimpleTest/TestRunner.js, line 157: SecurityError: Permission denied to access property "wrappedJSObject" on cross-origin object
 [test_optionalArguments.html]
 [test_overlapping_transactions.html]
 [test_persistenceType.html]
 [test_put_get_values.html]
 [test_put_get_values_autoIncrement.html]
 [test_readonly_transactions.html]
+skip-if = xorigin # JavaScript error: http://mochi.xorigin-test:8888/tests/SimpleTest/TestRunner.js, line 157: SecurityError: Permission denied to access property "wrappedJSObject" on cross-origin object
 [test_readwriteflush_disabled.html]
 [test_remove_index.html]
 [test_rename_index.html]
 skip-if = os == "linux" && os_version == "18.04" #Bug 1601601
 [test_rename_index_errors.html]
 [test_remove_objectStore.html]
 [test_rename_objectStore.html]
 [test_rename_objectStore_errors.html]
--- a/dom/media/test/mochitest.ini
+++ b/dom/media/test/mochitest.ini
@@ -799,17 +799,17 @@ skip-if = toolkit == 'android' # bug 110
 [test_duration_after_error.html]
 [test_eme_autoplay.html]
 skip-if = toolkit == 'android' # bug 1149374
 scheme=https
 [test_eme_pssh_in_moof.html]
 skip-if = toolkit == 'android' # bug 1149374
 scheme=https
 [test_eme_session_callable_value.html]
-skip-if = (verify && debug && (os == 'linux'))
+skip-if = verify && debug && (os == 'linux')
 scheme=https
 [test_eme_canvas_blocked.html]
 skip-if = toolkit == 'android' # bug 1149374
 scheme=https
 [test_eme_detach_media_keys.html]
 skip-if = toolkit == 'android' || (verify && debug && (os == 'linux' || os == 'win')) # bug 1149374
 scheme=https
 [test_eme_detach_reattach_same_mediakeys_during_playback.html]
@@ -850,20 +850,20 @@ scheme=https
 tags=mtg capturestream
 skip-if = toolkit == 'android' # bug 1149374
 scheme=https
 [test_eme_stream_capture_blocked_case3.html]
 tags=mtg capturestream
 skip-if = toolkit == 'android' # bug 1149374
 scheme=https
 [test_eme_unsetMediaKeys_then_capture.html]
-skip-if = toolkit == 'android' # bug 1149374
+skip-if = xorigin || toolkit == 'android' # bug 1149374
 scheme=https
 [test_eme_waitingforkey.html]
-skip-if = toolkit == 'android' # bug 1149374
+skip-if = xorigin || toolkit == 'android' # bug 1149374
 scheme=https
 [test_eme_getstatusforpolicy.html]
 skip-if = toolkit == 'android' # bug 1149374
 scheme=https
 [test_empty_resource.html]
 [test_error_in_video_document.html]
 [test_error_on_404.html]
 [test_fastSeek.html]
@@ -879,17 +879,17 @@ scheme=https
 [test_load_same_resource.html]
 [test_load_source.html]
 [test_load_source_empty_type.html]
 [test_loop.html]
 [test_looping_eventsOrder.html]
 [test_media_selection.html]
 [test_media_sniffer.html]
 [test_mediarecorder_avoid_recursion.html]
-skip-if = (os == 'win' && !debug)
+skip-if = os == 'win' && !debug
 scheme=https
 tags=mtg
 [test_mediarecorder_bitrate.html]
 skip-if = toolkit == 'android' # bug 1297432, android(bug 1232305)
 tags=mtg
 [test_mediarecorder_creation.html]
 tags=mtg capturestream
 [test_mediarecorder_creation_fail.html]
--- a/dom/midi/tests/mochitest.ini
+++ b/dom/midi/tests/mochitest.ini
@@ -1,12 +1,14 @@
 [DEFAULT]
 support-files =
   MIDITestUtils.js
 scheme = https
+skip-if = xorigin
+
 
 [test_midi_permission_prompt.html]
 [test_midi_permission_allow.html]
 [test_midi_permission_deny.html]
 [test_midi_device_enumeration.html]
 [test_midi_device_implicit_open_close.html]
 [test_midi_device_explicit_open_close.html]
 [test_midi_device_sysex.html]
--- a/dom/notification/test/mochitest/mochitest.ini
+++ b/dom/notification/test/mochitest/mochitest.ini
@@ -6,13 +6,15 @@ support-files =
   MockServices.js
   NotificationTest.js
 skip-if = toolkit == 'android' && !is_fennec # Bug 1531097
 
 [test_notification_basics.html]
 [test_notification_crossorigin_iframe.html]
 # This test needs to be run on HTTP (not HTTPS).
 [test_notification_insecure_context.html]
+fail-if = xorigin
 [test_notification_permissions.html]
 scheme = https
 [test_notification_storage.html]
 [test_bug931307.html]
 [test_notification_tag.html]
+skip-if = xorigin  # Application time out
--- a/dom/permission/tests/mochitest.ini
+++ b/dom/permission/tests/mochitest.ini
@@ -4,8 +4,9 @@ support-files =
 prefs =
   dom.security.featurePolicy.enabled=true
   dom.security.featurePolicy.header.enabled=true
   dom.security.featurePolicy.webidl.enabled=true
 
 [test_cross_origin_iframe.html]
 skip-if = fission #Bug 1580462
 [test_permissions_api.html]
+skip-if = xorigin # Hangs
--- a/dom/plugins/test/mochitest/mochitest.ini
+++ b/dom/plugins/test/mochitest/mochitest.ini
@@ -26,29 +26,35 @@ support-files =
   npruntime_identifiers_subpage.html
   plugin-stream-referer.sjs
   plugin_window.html
   pluginstream.js
   post.sjs
   plugin-utils.js
 
 [test_bug1028200-1.html]
-skip-if = !crashreporter
+skip-if = xorigin || !crashreporter
 [test_bug1028200-2.html]
 skip-if = !crashreporter
+  || xorigin # Hangs JavaScript error: http://mochi.xorigin-test:8888/tests/SimpleTest/TestRunner.js, line 157: SecurityError: Permission denied to access property "wrappedJSObject" on cross-origin object
 [test_bug1028200-3.html]
 skip-if = !crashreporter
+  || xorigin # Hangs, ReferenceError: can't access lexical declaration `load' before initialization at onload@http://mochi.test:8888/tests/dom/plugins/test/mochitest/test_bug1028200-3.html:1:1`,  TypeError: parentRunner.expectChildProcessCrash is not a function at SimpleTest.expectChildProcessCrash@http://mochi.test:8888/tests/SimpleTest/SimpleTest.js:1754:18
 [test_bug1028200-4.html]
 skip-if = !crashreporter
+  || xorigin # Hangs, TypeError: parentRunner.expectChildProcessCrash is not a function at SimpleTest.expectChildProcessCrash@http://mochi.test:8888/tests/SimpleTest/SimpleTest.js:1754:18
 [test_bug1028200-5.html]
 skip-if = !crashreporter
+  || xorigin # Hangs, TypeError: parentRunner.expectChildProcessCrash is not a function at SimpleTest.expectChildProcessCrash@http://mochi.test:8888/tests/SimpleTest/SimpleTest.js:1754:18
 [test_bug1028200-6.html]
 skip-if = !crashreporter
+  || xorigin # Hangs, TypeError: parentRunner.expectChildProcessCrash is not a function at SimpleTest.expectChildProcessCrash@http://mochi.test:8888/tests/SimpleTest/SimpleTest.js:1754:18
 [test_bug1028200-7.html]
 skip-if = !crashreporter
+  || xorigin # Hangs, TypeError: parentRunner.expectChildProcessCrash is not a function at SimpleTest.expectChildProcessCrash@http://mochi.test:8888/tests/SimpleTest/SimpleTest.js:1754:18
 [test_bug532208.html]
 [test_bug539565-1.html]
 [test_bug539565-2.html]
 [test_bug771202.html]
 [test_bug777098.html]
 [test_bug784131.html]
 [test_bug813906.html]
 [test_bug852315.html]
@@ -72,16 +78,17 @@ support-files = cocoa_focus.html
 skip-if = toolkit != "cocoa" # Bug 1194534
 support-files = cocoa_window_focus.html
 [test_copyText.html]
 skip-if = toolkit != "gtk"
 [test_crash_nested_loop.html]
 skip-if = toolkit != "gtk"
 [test_crashing.html]
 skip-if = !crashreporter
+  || xorigin # Hangs, TypeError: parentRunner.expectChildProcessCrash is not a function at SimpleTest.expectChildProcessCrash@http://mochi.test:8888/tests/SimpleTest/SimpleTest.js:1754:18
 [test_crashing2.html]
 skip-if = (!crashreporter) || true # Bug 566049
 [test_CrashService_crash.html]
 skip-if = !crashreporter || e10s
 [test_CrashService_hang.html]
 skip-if = !crashreporter || e10s
 [test_defaultValue.html]
 skip-if = (verify && !debug && (os == 'linux'))
@@ -116,31 +123,34 @@ skip-if = true # Bug 596491
 [test_pluginstream_err.html]
 [test_pluginstream_geturl.html]
 skip-if = true # Bug 1267432
 [test_pluginstream_geturlnotify.html]
 skip-if = true # Bug 1267432
 [test_pluginstream_post.html]
 [test_pluginstream_poststream.html]
 [test_pluginstream_referer.html]
+fail-if = xorigin
 [test_pluginstream_src.html]
 [test_pluginstream_src_dynamic.html]
 [test_pluginstream_src_referer.html]
+fail-if = xorigin
 [test_positioning.html]
 skip-if = true # disabled due to oddness, perhaps scrolling of the mochitest window?
 [test_propertyAndMethod.html]
 [test_queryCSSZoomFactor.html]
 [test_queryContentsScaleFactor.html]
 skip-if = (toolkit != "cocoa") || (os != "win")
 [test_queryContentsScaleFactorWindowed.html]
 skip-if = (toolkit != "cocoa") || (os != "win")
 [test_redirect_handling.html]
 [test_refresh_navigator_plugins.html]
 skip-if = e10s # Bug 1090576
 [test_secondPlugin.html]
+fail-if = xorigin
 [test_src_url_change.html]
 [test_streamatclose.html]
 [test_streamNotify.html]
 [test_stringHandling.html]
 [test_visibility.html]
 skip-if = toolkit == "cocoa"
 [test_windowed_invalidate.html]
 skip-if = os != "win" || webrender # win/webrender bug 1296400
--- a/dom/push/test/mochitest.ini
+++ b/dom/push/test/mochitest.ini
@@ -3,16 +3,17 @@ skip-if = os == "android"
 support-files =
   worker.js
   frame.html
   webpush.js
   lifetime_worker.js
   test_utils.js
   mockpushserviceparent.js
   error_worker.js
+fail-if = xorigin
 
 [test_has_permissions.html]
 [test_permissions.html]
 [test_register.html]
 skip-if = os == "win" # Bug 1373346
 [test_register_key.html]
 scheme = https
 [test_multiple_register.html]
--- a/dom/quota/test/mochitest/mochitest.ini
+++ b/dom/quota/test/mochitest/mochitest.ini
@@ -3,13 +3,14 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 [DEFAULT]
 support-files =
   helpers.js
 
 [test_simpledb.html]
 [test_storage_manager_persist_allow.html]
+fail-if = xorigin
 scheme=https
 [test_storage_manager_persist_deny.html]
 scheme=https
 [test_storage_manager_persisted.html]
 scheme=https
--- a/dom/security/featurepolicy/test/mochitest/mochitest.ini
+++ b/dom/security/featurepolicy/test/mochitest/mochitest.ini
@@ -3,9 +3,10 @@ prefs =
   dom.security.featurePolicy.enabled=true
   dom.security.featurePolicy.header.enabled=true
   dom.security.featurePolicy.webidl.enabled=true
 support-files =
   empty.html
   test_parser.html^headers^
 
 [test_parser.html]
+fail-if = xorigin
 [test_featureList.html]
--- a/dom/security/test/csp/mochitest.ini
+++ b/dom/security/test/csp/mochitest.ini
@@ -241,27 +241,29 @@ support-files =
 prefs =
   security.mixed_content.upgrade_display_content=false
 
 [test_base-uri.html]
 [test_blob_data_schemes.html]
 [test_connect-src.html]
 [test_CSP.html]
 [test_bug1452037.html]
+skip-if = xorigin # JavaScript error: http://mochi.xorigin-test:8888/tests/SimpleTest/TestRunner.js, line 157: SecurityError: Permission denied to access property "wrappedJSObject" on cross-origin object
 [test_allow_https_schemes.html]
 [test_bug663567.html]
 [test_bug802872.html]
 [test_bug885433.html]
 [test_bug888172.html]
 [test_bug1505412.html]
 skip-if = !debug
 [test_evalscript.html]
 [test_evalscript_blocked_by_strict_dynamic.html]
 [test_evalscript_allowed_by_strict_dynamic.html]
 [test_frameancestors.html]
+skip-if = xorigin # JavaScript error: http://mochi.xorigin-test:8888/tests/SimpleTest/TestRunner.js, line 157: SecurityError: Permission denied to access property "wrappedJSObject" on cross-origin object
 [test_frameancestors_userpass.html]
 [test_inlinescript.html]
 [test_inlinestyle.html]
 [test_invalid_source_expression.html]
 [test_bug836922_npolicies.html]
 skip-if = verify
 [test_bug886164.html]
 [test_redirects.html]
@@ -274,22 +276,24 @@ skip-if = verify
 [test_policyuri_regression_from_multipolicy.html]
 [test_nonce_source.html]
 [test_nonce_redirects.html]
 [test_bug941404.html]
 [test_form-action.html]
 [test_hash_source.html]
 [test_scheme_relative_sources.html]
 [test_ignore_unsafe_inline.html]
+skip-if = xorigin # JavaScript error: http://mochi.xorigin-test:8888/tests/SimpleTest/TestRunner.js, line 157: SecurityError: Permission denied to access property "wrappedJSObject" on cross-origin object, [Child 3789, Main Thread] WARNING: NS_ENSURE_TRUE(request) failed: file /builds/worker/checkouts/gecko/netwerk/base/nsLoadGroup.cpp, line 591
 [test_self_none_as_hostname_confusion.html]
 [test_empty_directive.html]
 [test_path_matching.html]
 [test_path_matching_redirect.html]
 [test_report_uri_missing_in_report_only_header.html]
 [test_report.html]
+fail-if = xorigin
 [test_301_redirect.html]
 [test_302_redirect.html]
 [test_303_redirect.html]
 [test_307_redirect.html]
 [test_subframe_run_js_if_allowed.html]
 [test_leading_wildcard.html]
 [test_multi_policy_injection_bypass.html]
 [test_null_baseuri.html]
@@ -297,16 +301,17 @@ skip-if = verify
 [test_win_open_blocked.html]
 [test_upgrade_insecure.html]
 # no ssl support as well as websocket tests do not work (see test_websocket.html)
 skip-if = (os != 'linux' && !debug) # Bug 1183300
 [test_upgrade_insecure_reporting.html]
 [test_upgrade_insecure_cors.html]
 [test_upgrade_insecure_loopback.html]
 [test_report_for_import.html]
+fail-if = xorigin
 [test_blocked_uri_in_reports.html]
 [test_service_worker.html]
 [test_child-src_worker.html]
 [test_child-src_worker_data.html]
 [test_child-src_worker-redirect.html]
 [test_child-src_iframe.html]
 [test_meta_element.html]
 [test_meta_header_dual.html]
@@ -333,16 +338,17 @@ tags = mcb
 [test_upgrade_insecure_navigation.html]
 [test_punycode_host_src.html]
 [test_iframe_sandbox_srcdoc.html]
 [test_iframe_srcdoc.html]
 [test_image_nonce.html]
 [test_websocket_self.html]
 skip-if = toolkit == 'android' # no websocket support Bug 982828
 [test_ignore_xfo.html]
+skip-if = xorigin # JavaScript error: http://mochi.xorigin-test:8888/tests/SimpleTest/TestRunner.js, line 157: SecurityError: Permission denied to access property "wrappedJSObject" on cross-origin object
 [test_data_csp_inheritance.html]
 [test_data_csp_merge.html]
 [test_report_font_cache.html]
 [test_data_doc_ignore_meta_csp.html]
 [test_meta_csp_self.html]
 [test_uir_top_nav.html]
 support-files =
   file_uir_top_nav.html
@@ -368,16 +374,17 @@ support-files =
   file_frame_src_inner.html
 [test_security_policy_violation_event.html]
 [test_csp_worker_inheritance.html]
 support-files =
   worker.sjs
   worker_helper.js
   main_csp_worker.html
   main_csp_worker.html^headers^
+skip-if = xorigin # CPP errors, 'NS_FAILED(rv)', file /builds/worker/checkouts/gecko/caps/ContentPrincipal.cpp, line 398
 [test_nonce_snapshot.html]
 support-files =
   file_nonce_snapshot.sjs
 [test_uir_windowwatcher.html]
 support-files =
   file_windowwatcher_frameA.html
   file_windowwatcher_subframeB.html
   file_windowwatcher_subframeC.html
--- a/dom/security/test/general/mochitest.ini
+++ b/dom/security/test/general/mochitest.ini
@@ -34,23 +34,30 @@ support-files =
 [test_block_script_wrong_mime.html]
 [test_block_toplevel_data_navigation.html]
 [test_block_toplevel_data_img_navigation.html]
 [test_allow_opening_data_pdf.html]
 skip-if = toolkit == 'android' # no pdf reader on Android
 [test_allow_opening_data_json.html]
 [test_block_subresource_redir_to_data.html]
 [test_same_site_cookies_subrequest.html]
+fail-if = xorigin # Cookies set incorrectly
 [test_same_site_cookies_toplevel_nav.html]
+fail-if = xorigin
 [test_same_site_cookies_cross_origin_context.html]
 [test_same_site_cookies_from_script.html]
+fail-if = xorigin
 [test_same_site_cookies_redirect.html]
+skip-if = xorigin # Hangs,  WARNING: 'NS_FAILED(rv)', file /builds/worker/checkouts/gecko/caps/ContentPrincipal.cpp, line 398
 [test_same_site_cookies_toplevel_set_cookie.html]
+fail-if = xorigin # Cookies not set
 [test_same_site_cookies_iframe.html]
+fail-if = xorigin
 [test_same_site_cookies_about.html]
+fail-if = xorigin
 [test_assert_about_page_no_csp.html]
 skip-if = !debug
 [test_same_site_cookies_laxByDefault.html]
 skip-if =  debug
 support-files = closeWindow.sjs
 [test_xfo_error_page.html]
 support-files = file_xfo_error_page.sjs
 [test_sec_fetch_websocket.html]
--- a/dom/security/test/general/test_same_site_cookies_redirect.html
+++ b/dom/security/test/general/test_same_site_cookies_redirect.html
@@ -17,17 +17,17 @@
  * 2) We then load an iframe that redirects
  *    (a) from same-origin to cross-origin
  *    (b) from cross-origin to same-origin
  * 3) We observe that in both cases same-site cookies should not be send
  */
 
 SimpleTest.waitForExplicitFinish();
 
-const SAME_ORIGIN = "http://mochi.test:8888/"
+const SAME_ORIGIN = location.origin + "/";
 const CROSS_ORIGIN = "http://example.com/";
 const PATH = "tests/dom/security/test/general/file_same_site_cookies_redirect.sjs";
 
 let curTest = 0;
 
 var tests = [
   {
     description: "baseline: same-site cookie, redirect same-site to same-site",
--- a/dom/security/test/https-only/mochitest.ini
+++ b/dom/security/test/https-only/mochitest.ini
@@ -1,13 +1,14 @@
 [DEFAULT]
 support-files =
   file_redirect.sjs
   file_upgrade_insecure.html
   file_upgrade_insecure_server.sjs
   file_upgrade_insecure_wsh.py
 prefs =
   security.mixed_content.upgrade_display_content=false
+skip-if = xorigin
 
 [test_resource_upgrade.html]
 scheme=https
 [test_redirect_upgrade.html]
 scheme=https
--- a/dom/security/test/mixedcontentblocker/mochitest.ini
+++ b/dom/security/test/mixedcontentblocker/mochitest.ini
@@ -24,9 +24,10 @@ support-files =
 skip-if =
   (toolkit == 'android') || webrender || (verify && !debug && (os == 'linux')) || # Android: TIMED_OUT; bug 1402554
   tsan # Times out / Memory consumption, bug 1612707
 [test_bug803225.html]
 skip-if = (os=='linux' && bits==32) || headless || tsan # Linux32:bug 1324870; Headless:bug 1405870; tsan:bug 1612707
 [test_frameNavigation.html]
 fail-if = fission
 skip-if = webrender || (debug && (os == 'linux' || os == 'win')) || (os == 'win' && !debug) # webrender: bug 1424752 # Bug 1391823; Bug 1353608
+  || xorigin  # Application time out
 [test_redirect.html]
--- a/dom/security/test/referrer-policy/test_referrer_header_current_document.html
+++ b/dom/security/test/referrer-policy/test_referrer_header_current_document.html
@@ -7,17 +7,17 @@
 
   <!--
   Testing that navigating to a document with Referrer-Policy:same-origin doesn't affect
   the value of document.referrer for that document.
   https://bugzilla.mozilla.org/show_bug.cgi?id=1601743
   -->
 
   <script type="application/javascript">
-    const IFRAME_URL = "http://mochi.test:8888/tests/dom/security/test/referrer-policy/referrer_header_current_document_iframe.html";
+    const IFRAME_URL = `${location.origin}/tests/dom/security/test/referrer-policy/referrer_header_current_document_iframe.html`;
     SimpleTest.waitForExplicitFinish();
     window.addEventListener("message", (event) => {
       SimpleTest.is(event.data, IFRAME_URL, "Must have the original iframe as the referrer!"); 
       SimpleTest.finish();
     }, { once: true });
   </script>
 </head>
 
--- a/dom/security/test/sri/mochitest.ini
+++ b/dom/security/test/sri/mochitest.ini
@@ -33,14 +33,19 @@ support-files =
   style6.css
   style6.css^headers^
   style_301.css
   style_301.css^headers^
   style_importing.css
   style_imported.css
 
 [test_script_sameorigin.html]
+skip-if = xorigin # JavaScript error: http://mochi.xorigin-test:8888/tests/SimpleTest/TestRunner.js, line 157: SecurityError: Permission denied to access property "wrappedJSObject" on cross-origin object
 [test_script_crossdomain.html]
+skip-if = xorigin # JavaScript error: http://mochi.xorigin-test:8888/tests/SimpleTest/TestRunner.js, line 157: SecurityError: Permission denied to access property "wrappedJSObject" on cross-origin object
 [test_sri_disabled.html]
+skip-if = xorigin # JavaScript error: http://mochi.xorigin-test:8888/tests/SimpleTest/TestRunner.js, line 157: SecurityError: Permission denied to access property "wrappedJSObject" on cross-origin object
 [test_style_crossdomain.html]
+skip-if = xorigin # JavaScript error: http://mochi.xorigin-test:8888/tests/SimpleTest/TestRunner.js, line 157: SecurityError: Permission denied to access property "wrappedJSObject" on cross-origin object
 [test_style_sameorigin.html]
+skip-if = xorigin # JavaScript error: http://mochi.xorigin-test:8888/tests/SimpleTest/TestRunner.js, line 157: SecurityError: Permission denied to access property "wrappedJSObject" on cross-origin object
 [test_bug_1271796.html]
 [test_bug_1364262.html]
--- a/dom/serviceworkers/test/mochitest.ini
+++ b/dom/serviceworkers/test/mochitest.ini
@@ -269,37 +269,40 @@ support-files = console_monitor.js
 [test_https_synth_fetch_from_cached_sw.html]
 [test_imagecache.html]
 [test_imagecache_max_age.html]
 [test_importscript.html]
 [test_importscript_mixedcontent.html]
 tags = mcb
 [test_install_event.html]
 [test_install_event_gc.html]
+skip-if = xorigin # JavaScript error: http://mochi.xorigin-test:8888/tests/SimpleTest/TestRunner.js, line 157: SecurityError: Permission denied to access property "wrappedJSObject" on cross-origin object
 [test_installation_simple.html]
 [test_match_all.html]
 [test_match_all_advanced.html]
 [test_match_all_client_id.html]
 skip-if = toolkit == 'android' && !is_fennec
 [test_match_all_client_properties.html]
 skip-if = toolkit == 'android' && !is_fennec
 [test_navigator.html]
 [test_not_intercept_plugin.html]
 skip-if = serviceworker_e10s # leaks InterceptedHttpChannel and others things
 [test_notification_constructor_error.html]
 [test_notification_get.html]
 [test_notification_openWindow.html]
 skip-if = toolkit == 'android' && !is_fennec # Bug 1620052
+  || xorigin # JavaScript error: http://mochi.xorigin-test:8888/tests/SimpleTest/TestRunner.js, line 157: SecurityError: Permission denied to access property "wrappedJSObject" on cross-origin object
 support-files = notification_openWindow_worker.js file_notification_openWindow.html
 tags = openwindow
 [test_notificationclick.html]
 [test_notificationclick_focus.html]
 [test_notificationclick-otherwindow.html]
 [test_notificationclose.html]
 [test_onmessageerror.html]
+skip-if = xorigin # Hangs with no error log
 [test_opaque_intercept.html]
 [test_openWindow.html]
 skip-if = toolkit == 'android' && !is_fennec # Bug 1620052
 tags = openwindow
 [test_origin_after_redirect.html]
 [test_origin_after_redirect_cached.html]
 [test_origin_after_redirect_to_https.html]
 [test_origin_after_redirect_to_https_cached.html]
--- a/dom/tests/mochitest/bugs/mochitest.ini
+++ b/dom/tests/mochitest/bugs/mochitest.ini
@@ -38,19 +38,21 @@ support-files =
   test2_bug622361.html
   file1_bug414291.html
   file2_bug414291.html
 prefs =
   plugin.load_flash_only=false
 
 [test_DOMWindowCreated_chromeonly.html]
 [test_bug132255.html]
+fail-if = xorigin
 [test_bug1551425_reference_to_childnodes_nodelist_keeps_childnodes_alive.html]
 [test_bug159849.html]
 [test_bug289714.html]
+fail-if = xorigin
 [test_bug260264.html]
 skip-if = toolkit == 'android'
 [test_bug260264_nested.html]
 [test_bug265203.html]
 [test_bug291377.html]
 [test_bug304459.html]
 [test_bug308856.html]
 [test_bug327891.html]
@@ -81,16 +83,17 @@ reason = Plugins are not supported on An
 [test_bug456151.html]
 [test_bug458091.html]
 skip-if = toolkit == 'android' && !is_fennec # Bug 1525959
 [test_bug459848.html]
 [test_bug465263.html]
 [test_bug484775.html]
 [test_bug492925.html]
 [test_bug49312.html]
+fail-if = xorigin
 [test_bug495219.html]
 [test_bug529328.html]
 [test_bug531176.html]
 [test_bug531542.html]
 [test_bug534149.html]
 [test_bug541530.html]
 [test_bug545314.html]
 [test_bug548828.html]
@@ -153,8 +156,9 @@ skip-if = toolkit == 'android' #Windows 
 [test_bug1171215.html]
 support-files = window_bug1171215.html
 [test_bug1530292.html]
 [test_instanceof_error_message.html]
 [test_bug467035.html]
 [test_no_find_showDialog.html]
 skip-if = toolkit == 'android' # Bug 1358633 - window.find doesn't work for Android
 [test_postmessage.html]
+skip-if = xorigin # JavaScript error: http://mochi.xorigin-test:8888/tests/SimpleTest/TestRunner.js, line 157: SecurityError: Permission denied to access property "wrappedJSObject" on cross-origin object
--- a/dom/tests/mochitest/fetch/fetch_test_framework.js
+++ b/dom/tests/mochitest/fetch/fetch_test_framework.js
@@ -154,15 +154,17 @@ function testScript(script) {
     })
     .catch(function(e) {
       ok(false, "Some test failed in " + script);
       info(e);
       info(e.message);
       return Promise.resolve();
     })
     .then(function() {
-      if (parent && parent.finishTest) {
-        parent.finishTest();
-      } else {
-        SimpleTest.finish();
-      }
+      try {
+        if (parent && parent.finishTest) {
+          parent.finishTest();
+          return;
+        }
+      } catch {}
+      SimpleTest.finish();
     });
 }
--- a/dom/tests/mochitest/fetch/mochitest.ini
+++ b/dom/tests/mochitest/fetch/mochitest.ini
@@ -42,17 +42,16 @@ support-files =
   !/dom/html/test/form_submit_server.sjs
   !/dom/security/test/cors/file_CrossSiteXHR_server.sjs
   !/dom/security/test/csp/file_redirects_resource.sjs
   !/dom/base/test/referrer_helper.js
   !/dom/base/test/referrer_testserver.sjs
   !/dom/promise/tests/test_webassembly_compile_sample.wasm
 prefs =
   javascript.options.streams=true
-
 [test_headers.html]
 [test_headers_sw_reroute.html]
 [test_headers_mainthread.html]
 [test_fetch_basic.html]
 [test_fetch_basic_sw_reroute.html]
 [test_fetch_basic_sw_empty_reroute.html]
 [test_fetch_basic_http.html]
 [test_fetch_basic_http_sw_reroute.html]
--- a/dom/tests/mochitest/general/mochitest.ini
+++ b/dom/tests/mochitest/general/mochitest.ini
@@ -117,22 +117,24 @@ skip-if = verify
 [test_pointerPreserves3DClip.html]
 [test_pointerPreserves3DPerspective.html]
 [test_resource_timing.html]
 skip-if = verify
 [test_resource_timing_cross_origin.html]
 [test_resource_timing_frameset.html]
 [test_selectevents.html]
 skip-if = toolkit == 'android' # bug 1627523
+  || xorigin
 [test_showModalDialog_removed.html]
 [test_storagePermissionsAccept.html]
 [test_storagePermissionsLimitForeign.html]
 [test_storagePermissionsReject.html]
 [test_storagePermissionsRejectForeign.html]
 [test_stylesheetPI.html]
 [test_toggling_performance_navigation_timing.html]
 [test_vibrator.html]
+fail-if = xorigin
 [test_WebKitCSSMatrix.html]
 [test_windowedhistoryframes.html]
 [test_windowProperties.html]
 [test_resource_timing_nocors.html]
 [test_resizeby.html]
 skip-if = (toolkit == 'android') || (devedition && os == 'win' && bits == 32) || (os == 'linux' && bits == 64) # Window sizes cannot be controled on android; Windows: bug 1540554; Bug 1604152
--- a/dom/tests/mochitest/geolocation/mochitest.ini
+++ b/dom/tests/mochitest/geolocation/mochitest.ini
@@ -5,16 +5,17 @@ support-files =
   geolocation.html
   geolocation_common.js
   network_geolocation.sjs
   windowTest.html
 prefs =
   dom.security.featurePolicy.enabled=true
   dom.security.featurePolicy.header.enabled=true
   dom.security.featurePolicy.webidl.enabled=true
+skip-if = xorigin
 
 [test_allowCurrent.html]
 [test_allowWatch.html]
 [test_cachedPosition.html]
 [test_cancelCurrent.html]
 [test_cancelWatch.html]
 [test_clearWatch.html]
 [test_clearWatchBeforeAllowing.html]
--- a/dom/tests/mochitest/localstorage/mochitest.ini
+++ b/dom/tests/mochitest/localstorage/mochitest.ini
@@ -21,27 +21,33 @@ support-files =
 
 [test_brokenUTF-16.html]
 [test_bug600307-DBOps.html]
 [test_bug746272-1.html]
 [test_bug746272-2.html]
 skip-if = verify
 [test_cookieBlock.html]
 [test_embededNulls.html]
+fail-if = xorigin
 [test_keySync.html]
 [test_localStorageBase.html]
 skip-if = e10s
 [test_localStorageBaseSessionOnly.html]
 [test_localStorageCookieSettings.html]
+fail-if = xorigin
 [test_localStorageEnablePref.html]
+skip-if = xorigin # JavaScript error: http://mochi.xorigin-test:8888/tests/SimpleTest/TestRunner.js, line 157: SecurityError: Permission denied to access property "wrappedJSObject" on cross-origin object
 [test_localStorageKeyOrder.html]
+fail-if = xorigin # uncaught exception - SecurityError: The operation is insecure. at startTest@http://mochi.test:8888/tests/dom/tests/mochitest/localstorage/test_localStorageKeyOrder.html:59:5, interOriginTest.js:31:7, test_storageConstructor.html:13:3
 [test_localStorageOriginsDiff.html]
 [test_localStorageOriginsDomainDiffs.html]
 [test_localStorageOriginsEquals.html]
 [test_localStorageOriginsPortDiffs.html]
 [test_localStorageOriginsSchemaDiffs.html]
 [test_localStorageQuota.html]
+fail-if = xorigin # SecurityError: The operation is insecure. at onMessageReceived@http://mochi.test:8888/tests/dom/tests/mochitest/localstorage/interOriginTest.js:31:7, but passes locally
 [test_localStorageQuotaSessionOnly.html]
 skip-if = true # bug 1611317
 [test_localStorageQuotaSessionOnly2.html]
 skip-if = true # bug 1347690
 [test_localStorageReplace.html]
 [test_storageConstructor.html]
+fail-if = xorigin # SecurityError: The operation is insecure. at onMessageReceived@http://mochi.test:8888/tests/dom/tests/mochitest/localstorage/interOriginTest.js:31:7, but passes locally
--- a/dom/tests/mochitest/storageevent/mochitest.ini
+++ b/dom/tests/mochitest/storageevent/mochitest.ini
@@ -4,14 +4,15 @@ support-files =
   frameLocalStorageSlaveEqual.html
   frameLocalStorageSlaveNotEqual.html
   frameSessionStorageMasterEqual.html
   frameSessionStorageMasterNotEqual.html
   frameSessionStorageSlaveEqual.html
   frameSessionStorageSlaveNotEqual.html
   interOriginFrame.js
   interOriginTest2.js
+skip-if = xorigin
 
 [test_storageLocalStorageEventCheckNoPropagation.html]
 [test_storageLocalStorageEventCheckPropagation.html]
 [test_storageNotifications.html]
 [test_storageSessionStorageEventCheckNoPropagation.html]
 [test_storageSessionStorageEventCheckPropagation.html]
--- a/dom/u2f/tests/mochitest.ini
+++ b/dom/u2f/tests/mochitest.ini
@@ -13,17 +13,17 @@ support-files =
   pkijs/common.js
   pkijs/x509_schema.js
   pkijs/x509_simpl.js
   u2futil.js
 
 scheme = https
 
 # Feature does not function without e10s (Disabled in Bug 1297552)
-skip-if = !e10s
+skip-if = xorigin || !e10s
 
 [test_bind.html]
 [test_polyfill_interaction.html]
 [test_u2f_replaceable.html]
 [test_util_methods.html]
 [test_no_token.html]
 [test_register.html]
 [test_register_sign.html]
--- a/dom/url/tests/test_url.html
+++ b/dom/url/tests/test_url.html
@@ -373,26 +373,26 @@
     is(url.hostname, "localhost", "Setting bad hostname fails");
   </script>
 
   <script>
     var blob = new Blob(["a"]);
     var url = URL.createObjectURL(blob);
 
     var u = new URL(url);
-    is(u.origin, "http://mochi.test:8888", "The URL generated from a blob URI has an origin");
+    is(u.origin, location.origin, "The URL generated from a blob URI has an origin");
   </script>
 
   <script>
     var blob = new Blob(["a"]);
     var url = URL.createObjectURL(blob);
 
     var a = document.createElement("A");
     a.href = url;
-    is(a.origin, "http://mochi.test:8888", "The 'a' element has the correct origin");
+    is(a.origin, location.origin, "The 'a' element has the correct origin");
   </script>
 
   <script>
     var blob = new Blob(["a"]);
     var url = URL.createObjectURL(blob);
     URL.revokeObjectURL(url);
     URL.revokeObjectURL(url);
     ok(true, "Calling revokeObjectURL twice should be ok");
--- a/dom/url/tests/test_urlutils_stringify.html
+++ b/dom/url/tests/test_urlutils_stringify.html
@@ -27,12 +27,12 @@ https://bugzilla.mozilla.org/show_bug.cg
   is(url + "", "http://www.example.com:8080/", "URL stringify");
 
   var link = document.getElementById("link");
   is(link + "", "http://www.example.com:8080/", "Anchor stringify");
 
   var area = document.getElementById("area");
   is(area + "", "http://www.example.com:8080/", "Area stringify");
 
-  is((location + "").indexOf("http://mochi.test:8888/tests/dom/url/tests/test_urlutils_stringify.html"), 0, "Location stringify");
+  is((location + "").indexOf(`${location.origin}/tests/dom/url/tests/test_urlutils_stringify.html`), 0, "Location stringify");
   </script>
 </body>
 </html>
--- a/dom/url/tests/url_worker.js
+++ b/dom/url/tests/url_worker.js
@@ -85,14 +85,14 @@ onmessage = function(event) {
     type: "status",
     status: !!uri,
     msg: "The URI has been generated from the blob",
   });
 
   var u = new URL(uri);
   postMessage({
     type: "status",
-    status: u.origin == "http://mochi.test:8888",
+    status: u.origin == location.origin,
     msg: "The URL generated from a blob URI has an origin.",
   });
 
   postMessage({ type: "finish" });
 };
--- a/dom/webauthn/tests/mochitest.ini
+++ b/dom/webauthn/tests/mochitest.ini
@@ -1,15 +1,15 @@
 [DEFAULT]
 support-files =
   cbor.js
   u2futil.js
   pkijs/*
   get_assertion_dead_object.html
-skip-if = !e10s || os == 'android'
+skip-if = xorigin || !e10s || os == 'android'
 scheme = https
 
 [test_webauthn_abort_signal.html]
 [test_webauthn_attestation_conveyance.html]
 [test_webauthn_authenticator_selection.html]
 [test_webauthn_authenticator_transports.html]
 [test_webauthn_loopback.html]
 [test_webauthn_no_token.html]
--- a/dom/workers/test/mochitest.ini
+++ b/dom/workers/test/mochitest.ini
@@ -104,16 +104,17 @@ support-files =
   !/dom/events/test/event_leak_utils.js
 
 [test_404.html]
 [test_atob.html]
 [test_blobConstructor.html]
 [test_blobWorkers.html]
 [test_bug949946.html]
 [test_bug978260.html]
+skip-if = xorigin #  [Child][MessageChannel] Error: (msgtype=0x38006F,name=PContent::Reply_CrossProcessRedirect) Channel closing: too late to send/recv, messages will be lost, [Parent][MessageChannel] Error: (msgtype=0x20007A,name=PBrowser::Msg_StopIMEStateManagement) Closed channel: cannot send/recv
 [test_bug998474.html]
 [test_bug1002702.html]
 [test_bug1010784.html]
 [test_bug1014466.html]
 [test_bug1020226.html]
 [test_bug1036484.html]
 [test_bug1060621.html]
 [test_bug1062920.html]
@@ -171,26 +172,28 @@ support-files =
 [test_rvals.html]
 [test_sharedWorker.html]
 [test_sharedWorker_thirdparty.html]
 support-files =
   sharedWorker_thirdparty_frame.html
   sharedWorker_thirdparty_window.html
 [test_simpleThread.html]
 [test_suspend.html]
+fail-if = xorigin # Strip query parameters from xorigin url
 [test_terminate.html]
 [test_threadErrors.html]
 [test_threadTimeouts.html]
 [test_throwingOnerror.html]
 [test_timeoutTracing.html]
 [test_transferable.html]
 [test_worker_interfaces.html]
 [test_worker_interfaces_secureContext.html]
 scheme=https
 [test_referrer.html]
+fail-if = xorigin
 [test_referrer_header_worker.html]
 [test_importScripts_3rdparty.html]
 [test_sharedWorker_ports.html]
 [test_sharedWorker_lifetime.html]
 [test_navigator_workers_hardwareConcurrency.html]
 [test_bug1278777.html]
 [test_setTimeoutWith0.html]
 [test_bug1301094.html]
--- a/dom/xhr/tests/mochitest.ini
+++ b/dom/xhr/tests/mochitest.ini
@@ -78,16 +78,17 @@ support-files =
 [test_worker_xhr.html]
 [test_worker_xhr2.html]
 [test_worker_xhr_3rdparty.html]
 support-files = window_worker_xhr_3rdparty.html
 [test_worker_xhr_cors_redirect.html]
 [test_worker_xhr_headers.html]
 [test_worker_xhr_implicit_cancel.html]
 [test_worker_xhr_parameters.html]
+fail-if = xorigin
 [test_worker_xhr_responseURL.html]
 [test_worker_xhr_system.html]
 [test_worker_xhr_timeout.html]
 [test_worker_xhrAbort.html]
 skip-if = (os == "win") || (os == "mac")
 [test_XHR.html]
 [test_xhr_abort_after_load.html]
 [test_XHR_anon.html]
--- a/editor/libeditor/tests/mochitest.ini
+++ b/editor/libeditor/tests/mochitest.ini
@@ -43,16 +43,17 @@ skip-if = os == 'android'
 [test_bug408231.html]
 skip-if = toolkit == 'android'
 [test_bug410986.html]
 skip-if = headless
 [test_bug414526.html]
 [test_bug417418.html]
 [test_bug426246.html]
 [test_bug430392.html]
+skip-if = xorigin # Inconsistent pass/fail in opt and debug
 [test_bug432225.html]
 skip-if = toolkit == 'android'
 [test_bug439808.html]
 [test_bug442186.html]
 [test_bug449243.html]
 [test_bug455992.html]
 [test_bug456244.html]
 [test_bug460740.html]
@@ -176,16 +177,17 @@ skip-if = os != "win"
 skip-if = os == 'android'
 [test_bug1102906.html]
 skip-if = os == 'android'
 [test_bug1109465.html]
 [test_bug1130651.html]
 [test_bug1140105.html]
 [test_bug1140617.html]
 [test_bug1151186.html]
+skip-if = fission
 [test_bug1153237.html]
 [test_bug1154791.html]
 skip-if = os == 'android'
 [test_bug1162952.html]
 [test_bug1181130-1.html]
 [test_bug1181130-2.html]
 [test_bug1186799.html]
 [test_bug1230473.html]
@@ -228,16 +230,17 @@ skip-if = toolkit == 'android'
 [test_bug1574596.html]
 skip-if = os == "android" #Bug 1575739
 [test_bug1581337.html]
 [test_bug1619852.html]
 [test_bug1620778.html]
 [test_abs_positioner_appearance.html]
 [test_abs_positioner_positioning_elements.html]
 skip-if = os == 'android' # Bug 1525959
+  || xorigin # Inconsistent pass/fail in opt and debug
 [test_CF_HTML_clipboard.html]
 skip-if = os != 'mac' # bug 574005
 [test_cmd_fontFace_with_tt.html]
 [test_composition_event_created_in_chrome.html]
 [test_contenteditable_focus.html]
 [test_cut_copy_delete_command_enabled.html]
 [test_cut_copy_password.html]
 [test_documentCharacterSet.html]
@@ -281,16 +284,17 @@ skip-if = headless
 [test_password_input_with_unmasked_range.html]
 [test_password_paste.html]
 [test_password_per_word_operation.html]
 [test_password_unmask_API.html]
 [test_pasting_text_longer_than_maxlength.html]
 [test_resizers_appearance.html]
 [test_resizers_resizing_elements.html]
 skip-if = (verify && debug && os == 'win') # bug 1485293
+fail-if = xorigin
 [test_root_element_replacement.html]
 [test_select_all_without_body.html]
 [test_setting_value_longer_than_maxlength_with_setUserInput.html]
 [test_spellcheck_pref.html]
 skip-if = toolkit == 'android'
 [test_state_change_on_reframe.html]
 [test_textarea_value_not_include_cr.html]
 [test_typing_at_edge_of_anchor.html]
--- a/editor/libeditor/tests/test_nsIEditor_insertLineBreak.html
+++ b/editor/libeditor/tests/test_nsIEditor_insertLineBreak.html
@@ -34,17 +34,17 @@ SimpleTest.waitForFocus(async () => {
   function onBeforeInput(event) {
     beforeInputEvents.push(event);
   }
   function onInput(event) {
     inputEvents.push(event);
   }
 
   function checkInputEvent(aEvent, aInputType, aTargetRanges, aDescription) {
-    ok(aEvent, `aEvent is null (${aDescription})`);
+    ok(aEvent != null, `aEvent is null (${aDescription})`);
     ok(aEvent instanceof InputEvent,
        `"${aEvent.type}" event should be dispatched with InputEvent interface (${aDescription})`);
     is(aEvent.cancelable, aEvent.type === "beforeinput",
        `"${aEvent.type}" event should ${aEvent.type === "beforeinput" ? "be" : "be never"} cancelable (${aDescription})`);
     is(aEvent.bubbles, true,
        `"${aEvent.type}" event should always bubble (${aDescription})`);
     is(aEvent.inputType, aInputType,
        `inputType of "${aEvent.type}" event should be "${aInputType}" ${aDescription}`);
@@ -78,17 +78,17 @@ SimpleTest.waitForFocus(async () => {
   input.selectionStart = input.selectionEnd = 3;
   beforeInputEvents = [];
   inputEvents = [];
   input.addEventListener("beforeinput", onBeforeInput);
   input.addEventListener("input", onInput);
   try {
     getPlaintextEditor(input).insertLineBreak();
   } catch (e) {
-    ok(true, e);
+    ok(true, e.message);
   }
   input.removeEventListener("beforeinput", onBeforeInput);
   input.removeEventListener("input", onInput);
   is(input.value, "abcdef", "nsIEditor.insertLineBreak() should do nothing on single line editor");
   is(beforeInputEvents.length, 1, 'nsIEditor.insertLineBreak() should cause a "beforeinput" event on single line editor');
   checkInputEvent(beforeInputEvents[0], "insertLineBreak", [], "on single line editor");
   is(inputEvents.length, 0, 'nsIEditor.insertLineBreak() should not cause "input" event on single line editor');
 
--- a/gfx/layers/apz/test/mochitest/mochitest.ini
+++ b/gfx/layers/apz/test/mochitest/mochitest.ini
@@ -16,39 +16,45 @@
   skip-if = (os == 'android') # wheel events not supported on mobile
 [test_bug1304689.html]
 [test_bug1304689-2.html]
 [test_group_bug1464568.html]
 [test_frame_reconstruction.html]
 [test_group_fullscreen.html]
   run-if = (os == 'android')
 [test_group_mainthread.html]
+  skip-if = xorigin # JavaScript error: http://mochi.xorigin-test:8888/tests/SimpleTest/TestRunner.js, line 157: SecurityError: Permission denied to access property "wrappedJSObject" on cross-origin object
 [test_group_minimum_scale_size.html]
   run-if = (os == 'android')
 [test_group_mouseevents.html]
   skip-if = (toolkit == 'android') # mouse events not supported on mobile
+    || xorigin  # JavaScript error: http://mochi.xorigin-test:8888/tests/SimpleTest/TestRunner.js, line 157: SecurityError: Permission denied to access property "wrappedJSObject" on cross-origin object
 [test_group_pointerevents.html]
   skip-if = (os == 'win' && os_version == '10.0') # Bug 1404836
+    || xorigin  # Application time out
 [test_group_touchevents.html]
   skip-if = (verify && debug && (os == 'win'))
+    || xorigin # JavaScript error: http://mochi.xorigin-test:8888/tests/SimpleTest/TestRunner.js, line 157: SecurityError: Permission denied to access property "wrappedJSObject" on cross-origin object
 [test_group_touchevents-2.html]
   skip-if = (verify && debug && (os == 'win'))
 [test_group_touchevents-3.html]
   skip-if = (verify && debug && (os == 'win'))
 [test_group_touchevents-4.html]
   skip-if = (verify && debug && (os == 'win'))
+    || xorigin # JavaScript error: http://mochi.xorigin-test:8888/tests/SimpleTest/TestRunner.js, line 157: SecurityError: Permission denied to access property "wrappedJSObject" on cross-origin object
 [test_group_wheelevents.html]
   skip-if = (toolkit == 'android') # wheel events not supported on mobile
 [test_group_zoom.html]
   skip-if = (os == 'win') # see bug 1495580 for Windows
 [test_group_zoom-2.html]
   skip-if = (os == 'win') # see bug 1495580 for Windows
 [test_group_double_tap_zoom.html]
   run-if = (os == 'android') # FIXME: enable on desktop (see bug 1608506 comment 4)
 [test_interrupted_reflow.html]
+ fail-if = xorigin
 [test_group_keyboard.html]
 [test_layerization.html]
   skip-if = (os == 'android') # wheel events not supported on mobile
 [test_relative_update.html]
   skip-if = (os == 'android') # wheel events not supported on mobile
 [test_scroll_inactive_bug1190112.html]
   skip-if = (os == 'android') # wheel events not supported on mobile
 [test_scroll_inactive_flattened_frame.html]
@@ -60,12 +66,13 @@
 [test_wheel_scroll.html]
   skip-if = (os == 'android') # wheel events not supported on mobile
 [test_wheel_transactions.html]
   skip-if = (toolkit == 'android') # wheel events not supported on mobile
 [test_group_overrides.html]
   skip-if = (toolkit == 'android') # wheel events not supported on mobile
 [test_group_hittest.html]
   skip-if = (toolkit == 'android') # mouse events not supported on mobile
+    || xorigin # Hangs in helper_hittest_spam.html
 [test_group_zoomToFocusedInput.html]
 [test_group_scroll_snap.html]
   skip-if = (os == 'android') # wheel events not supported on mobile
 [test_group_checkerboarding.html]
--- a/image/test/mochitest/test_net_failedtoprocess.html
+++ b/image/test/mochitest/test_net_failedtoprocess.html
@@ -29,17 +29,17 @@ var observer = {
         aIID.equals(Ci.nsIObserver))
       return this;
     throw Components.Exception("", Cr.NS_ERROR_NO_INTERFACE);
   },
 
   observe(subject, topic, data) {
     ok(topic == "net:failed-to-process-uri-content", "wrong topic");
     subject = subject.QueryInterface(Ci.nsIURI);
-    is(subject.asciiSpec, "http://mochi.test:8888/tests/image/test/mochitest/invalid.jpg", "wrong subject");
+    is(subject.asciiSpec, `${location.origin}/tests/image/test/mochitest/invalid.jpg`, "wrong subject");
 
     obs.removeObserver(this, "net:failed-to-process-uri-content");
 
     SimpleTest.finish();
   }
 };
 
 obs.addObserver(SpecialPowers.wrapCallbackObject(observer), "net:failed-to-process-uri-content");
--- a/layout/base/tests/mochitest.ini
+++ b/layout/base/tests/mochitest.ini
@@ -56,16 +56,17 @@ support-files = bug558663.html
 [test_bug582181-2.html]
 [test_bug582771.html]
 [test_bug583889.html]
 support-files =
   bug583889_inner1.html
   bug583889_inner2.html
 [test_bug588174.html]
 [test_bug603550.html]
+fail-if = xorigin
 [test_bug607529.html]
 support-files =
   file_bug607529.html
   file_bug607529-1.html
 [test_bug629838.html]
 skip-if = toolkit == 'android' # android: Requires plugin support
 [test_bug644768.html]
 [test_bug646757.html]
@@ -139,16 +140,17 @@ support-files = bug1226904.html
 support-files = bug1448730.html
 [test_bug1515822.html]
 [test_bug1550869_video.html]
 [test_dynamic_toolbar_max_height.html]
 support-files = file_dynamic_toolbar_max_height.html
 [test_emulateMedium.html]
 [test_emulate_color_scheme.html]
 [test_event_target_radius.html]
+skip-if = xorigin # JavaScript error: resource://specialpowers/SpecialPowersChild.jsm, line 73: SecurityError: Permission denied to access property "windowUtils" on cross-origin object
 [test_flush_on_paint.html]
 skip-if = true # Bug 688128
 [test_frame_reconstruction_for_column_span.html]
 [test_frame_reconstruction_for_pseudo_elements.html]
 [test_frame_reconstruction_for_svg_transforms.html]
 [test_frame_reconstruction_scroll_restore.html]
 [test_frame_reconstruction_body_writing_mode.html]
 [test_frame_reconstruction_body_table.html]
@@ -162,16 +164,17 @@ support-files = window_empty_document.ht
 [test_mozPaintCount.html]
 skip-if = toolkit == 'android' # android: Requires plugin support
 [test_preserve3d_sorting_hit_testing.html]
 support-files = preserve3d_sorting_hit_testing_iframe.html
 [test_preserve3d_sorting_hit_testing2.html]
 support-files = preserve3d_sorting_hit_testing2_iframe.html
 [test_reftests_with_caret.html]
 skip-if = toolkit == 'android' || tsan # android: Bug 1355842. tsan: Bug 1612707
+fail-if = xorigin
 support-files =
   bug106855-1.html
   bug106855-2.html
   bug106855-1-ref.html
   bug240933-1.html
   bug240933-2.html
   bug240933-1-ref.html
   bug389321-1.html
--- a/layout/generic/test/mochitest.ini
+++ b/layout/generic/test/mochitest.ini
@@ -34,16 +34,17 @@ support-files = bug344830_testembed.svg
 [test_bug384527.html]
 [test_bug385751.html]
 [test_bug389630.html]
 [test_bug391747.html]
 [test_bug392746.html]
 [test_bug392923.html]
 [test_bug394173.html]
 [test_bug394239.html]
+skip-if = (xorigin && debug)
 [test_bug402380.html]
 [test_bug404872.html]
 [test_bug405178.html]
 [test_bug416168.html]
 [test_bug421436.html]
 [test_bug421839-1.html]
 skip-if = true # Disabled for calling finish twice
 [test_bug421839-2.html]
@@ -79,16 +80,17 @@ support-files = bug633762_iframe.html
 [test_bug719503.html]
 [test_bug719515.html]
 [test_bug719518.html]
 [test_bug719523.html]
 [test_bug735641.html]
 [test_bug748961.html]
 [test_bug756984.html]
 fail-if = (os == 'linux' && os_version == '18.04') # Bug 1600208 permafail on ubuntu1804
+  || xorigin
 [test_bug784410.html]
 [test_bug785324.html]
 [test_bug791616.html]
 [test_bug831780.html]
 [test_bug841361.html]
 [test_bug904810.html]
 [test_bug938772.html]
 [test_bug970363.html]
--- a/layout/style/test/mochitest.ini
+++ b/layout/style/test/mochitest.ini
@@ -69,16 +69,17 @@ support-files = Ahem.ttf file_animations
 [test_animations_dynamic_changes.html]
 [test_animations_effect_timing_duration.html]
 [test_animations_effect_timing_enddelay.html]
 [test_animations_effect_timing_iterations.html]
 [test_animations_event_order.html]
 [test_animations_event_handler_attribute.html]
 [test_animations_iterationstart.html]
 [test_animations_omta.html]
+fail-if = xorigin
 [test_animations_omta_start.html]
 [test_animations_pausing.html]
 [test_animations_playbackrate.html]
 [test_animations_reverse.html]
 [test_animations_styles_on_event.html]
 [test_animations_variable_changes.html]
 [test_animations_with_disabled_properties.html]
 support-files = file_animations_with_disabled_properties.html
@@ -109,16 +110,17 @@ support-files = file_animations_with_dis
 [test_bug379741.html]
 [test_bug382027.html]
 [test_bug383075.html]
 [test_bug387615.html]
 [test_bug389464.html]
 [test_bug391034.html]
 [test_bug391221.html]
 [test_bug397427.html]
+fail-if = xorigin
 [test_bug399349.html]
 [test_bug401046.html]
 skip-if = true # Bug 701060
 [test_bug405818.html]
 [test_bug412901.html]
 [test_bug413958.html]
 [test_bug418986-2.html]
 skip-if = (verify && os == 'mac')
@@ -269,16 +271,17 @@ support-files = slow_load.sjs
 [test_load_events_on_stylesheets.html]
 support-files = slow_broken_sheet.sjs slow_ok_sheet.sjs
 [test_logical_properties.html]
 [test_mask_image_CORS.html]
 [test_media_queries.html]
 # times out on verify, see bug 1461033.
 skip-if = verify
 [test_media_queries_dynamic.html]
+skip-if = xorigin # Crashes, Assertion failure: mInFlightProcessId == 0, at /builds/worker/checkouts/gecko/docshell/base/CanonicalBrowsingContext.cpp:110, [Child][MessageChannel] Error: (msgtype=0xFFF7,name=<unknown IPC msg name>) Channel error: cannot send/recv
 [test_media_query_list.html]
 [test_media_query_serialization.html]
 [test_mq_any_hover_and_any_pointer.html]
 [test_mq_changes_in_iframe.html]
 support-files = mq_changes_child.html
 run-if = !headless && (os == 'mac' || toolkit == 'android' || toolkit == 'gtk')
 [test_mq_hover_and_pointer.html]
 [test_mq_prefers_reduced_motion_dynamic.html]
@@ -317,16 +320,17 @@ support-files = redundant_font_download.
 [test_restyle_table_wrapper.html]
 [test_restyles_in_smil_animation.html]
 [test_root_node_display.html]
 [test_rule_insertion.html]
 [test_rule_serialization.html]
 [test_rules_out_of_sheets.html]
 [test_selectors.html]
 [test_setPropertyWithNull.html]
+skip-if = (xorigin && debug)
 [test_shape_outside_CORS.html]
 [test_shared_sheet_caching.html]
 support-files = file_shared_sheet_caching.css file_shared_sheet_caching.html
 [test_shorthand_property_getters.html]
 [test_specified_value_serialization.html]
 support-files = file_specified_value_serialization_individual_transforms.html
 [test_style_attr_listener.html]
 [test_style_attribute_quirks.html]
@@ -380,22 +384,26 @@ support-files = support/external-variabl
 skip-if = (verify && (os == 'win' || os == 'mac'))
 [test_viewport_units.html]
 [test_visited_image_loading.html]
 skip-if = toolkit == 'android' # TIMED_OUT for android
 [test_visited_image_loading_empty.html]
 skip-if = toolkit == 'android' # TIMED_OUT for android
 [test_visited_lying.html]
 skip-if = toolkit == 'android' # TIMED_OUT for android
+fail-if = xorigin
 [test_visited_pref.html]
 skip-if = toolkit == 'android' # TIMED_OUT for android
+fail-if = xorigin
 [test_visited_reftests.html]
 skip-if = toolkit == 'android' # TIMED_OUT for android
 [test_webkit_device_pixel_ratio.html]
+skip-if = xorigin # process crash: Assertion failure: mInFlightProcessId == 0, at /builds/worker/checkouts/gecko/docshell/base/CanonicalBrowsingContext.cpp:110
 [test_webkit_flex_display.html]
+skip-if = xorigin # Crashes, Assertion failure: mInFlightProcessId == 0, at /builds/worker/checkouts/gecko/docshell/base/CanonicalBrowsingContext.cpp:110
 [test_first_letter_restrictions.html]
 [test_first_line_restrictions.html]
 [test_marker_restrictions.html]
 [test_placeholder_restrictions.html]
 [test_mql_event_listener_leaks.html]
 [test_non_matching_sheet_media.html]
 [test_use_counters.html]
 skip-if = !nightly_build
--- a/netwerk/test/mochitests/mochitest.ini
+++ b/netwerk/test/mochitests/mochitest.ini
@@ -56,16 +56,17 @@ support-files =
   test1.css^headers^
   test2.css
   test2.css^headers^
 
 [test_arraybufferinputstream.html]
 [test_documentcookies_maxage.html]
 [test_idn_redirect.html]
 [test_loadinfo_redirectchain.html]
+fail-if = xorigin
 [test_partially_cached_content.html]
 [test_rel_preconnect.html]
 [test_redirect_ref.html]
 [test_uri_scheme.html]
 skip-if = (verify && debug && os == 'mac')
 [test_viewsource_unlinkable.html]
 [test_xhr_method_case.html]
 [test_1331680.html]
--- a/parser/htmlparser/tests/mochitest/mochitest.ini
+++ b/parser/htmlparser/tests/mochitest/mochitest.ini
@@ -100,26 +100,28 @@ support-files =
 [test_bug102699.html]
 [test_bug174351.html]
 [test_bug213517.html]
 [test_bug339350.xhtml]
 [test_bug358797.html]
 [test_bug396568.html]
 [test_bug418464.html]
 [test_bug460437.xhtml]
+skip-if = (xorigin && debug)
 [test_bug502091.html]
 [test_bug543062.html]
 [test_bug552938-2.html]
 [test_bug552938.html]
 [test_bug563322.xhtml]
 [test_bug566879.html]
 [test_bug594730.html]
 [test_bug599584.html]
 [test_bug613662.html]
 [test_bug613662.xhtml]
+skip-if = (xorigin && debug)
 [test_bug639362.html]
 [test_bug642908.html]
 [test_bug645115.html]
 [test_bug655682.html]
 [test_bug667533.html]
 [test_bug672453.html]
 [test_bug688580.html]
 [test_bug688580.xhtml]
--- a/security/manager/ssl/tests/mochitest/mixedcontent/test_bug521461.html
+++ b/security/manager/ssl/tests/mochitest/mixedcontent/test_bug521461.html
@@ -7,16 +7,17 @@
   <script type="text/javascript" src="/MochiKit/Style.js"></script>
   <script type="text/javascript" src="/MochiKit/Signal.js"></script>
   <script src="/tests/SimpleTest/SimpleTest.js"></script>
   <script type="text/javascript" src="mixedContentTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 
   <script class="testbody" type="text/javascript">
   "use strict";
+  SimpleTest.requestFlakyTimeout("Timeout in mixedContentTest");
 
   loadAsInsecure = true;
 
   async function runTest()
   {
     window.location = "https://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/nocontent.sjs";
     window.setTimeout(async () => {
       await isSecurityState("insecure", "location.href doesn't effect the security state");
--- a/security/manager/ssl/tests/mochitest/mixedcontent/test_dynUnsecurePicture.html
+++ b/security/manager/ssl/tests/mochitest/mixedcontent/test_dynUnsecurePicture.html
@@ -7,16 +7,17 @@
   <script type="text/javascript" src="/MochiKit/Style.js"></script>
   <script type="text/javascript" src="/MochiKit/Signal.js"></script>
   <script src="/tests/SimpleTest/SimpleTest.js"></script>
   <script type="text/javascript" src="mixedContentTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 
   <script class="testbody" type="text/javascript">
   "use strict";
+  SimpleTest.requestFlakyTimeout("Timeout in mixedContentTest");
 
   // This test, as is, equals to https://kuix.de/misc/test17/358438.php
 
   async function runTest()
   {
     await isSecurityState("secure");
     document.getElementById("image1").src =
       "http://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/moonsurface.jpg";
--- a/security/manager/ssl/tests/mochitest/mixedcontent/test_innerHtmlDelayedUnsecurePicture.html
+++ b/security/manager/ssl/tests/mochitest/mixedcontent/test_innerHtmlDelayedUnsecurePicture.html
@@ -7,16 +7,17 @@
   <script type="text/javascript" src="/MochiKit/Style.js"></script>
   <script type="text/javascript" src="/MochiKit/Signal.js"></script>
   <script src="/tests/SimpleTest/SimpleTest.js"></script>
   <script type="text/javascript" src="mixedContentTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 
   <script class="testbody" type="text/javascript">
   "use strict";
+  SimpleTest.requestFlakyTimeout("Timeout in mixedContentTest");
 
   async function runTest()
   {
     await isSecurityState("secure");
 
     window.setTimeout(function () {
       document.getElementById("buddy").innerHTML =
         "<img id='image1' src='http://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/moonsurface.jpg' />";
--- a/security/manager/ssl/tests/mochitest/mixedcontent/test_innerHtmlUnsecurePicture.html
+++ b/security/manager/ssl/tests/mochitest/mixedcontent/test_innerHtmlUnsecurePicture.html
@@ -7,16 +7,17 @@
   <script type="text/javascript" src="/MochiKit/Style.js"></script>
   <script type="text/javascript" src="/MochiKit/Signal.js"></script>
   <script src="/tests/SimpleTest/SimpleTest.js"></script>
   <script type="text/javascript" src="mixedContentTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 
   <script class="testbody" type="text/javascript">
   "use strict";
+  SimpleTest.requestFlakyTimeout("Timeout in mixedContentTest");
 
   async function runTest()
   {
     await isSecurityState("secure");
 
     document.getElementById("buddy").innerHTML =
       "<img id='image1' src='http://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/moonsurface.jpg' />";
 
--- a/toolkit/components/extensions/test/mochitest/mochitest-common.ini
+++ b/toolkit/components/extensions/test/mochitest/mochitest-common.ini
@@ -59,30 +59,32 @@ support-files =
   file_redirect_data_uri.html
   file_redirect_cors_bypass.html
 prefs =
   security.mixed_content.upgrade_display_content=false
   browser.chrome.guess_favicon=true
 
 [test_ext_activityLog.html]
 skip-if = os == 'android' || tsan # Times out on TSan, bug 1612707
+  || xorigin # Inconsistent pass/fail in opt and debug
 [test_ext_async_clipboard.html]
 skip-if = toolkit == 'android' || tsan # near-permafail after landing bug 1270059: Bug 1523131. tsan: bug 1612707
 [test_ext_background_canvas.html]
 [test_ext_background_page.html]
 skip-if = (toolkit == 'android') # android doesn't have devtools
 [test_ext_canvas_resistFingerprinting.html]
 [test_ext_clipboard.html]
 skip-if = os == 'android'
 [test_ext_clipboard_image.html]
 skip-if = headless # Bug 1405872
 [test_ext_contentscript_about_blank.html]
 skip-if = os == 'android' # bug 1369440
 [test_ext_contentscript_cache.html]
 skip-if = (os == 'linux' && debug) || (toolkit == 'android' && debug) # bug 1348241
+fail-if = xorigin # TypeError: can't access property "staticScripts", ext is undefined - Should not throw any errors
 [test_ext_contentscript_canvas.html]
 skip-if = (os == 'android') || (verify && debug && (os == 'linux')) # Bug 1617062
 [test_ext_contentscript_devtools_metadata.html]
 [test_ext_contentscript_fission_frame.html]
 [test_ext_contentscript_incognito.html]
 skip-if = os == 'android' # Android does not support multiple windows.
 [test_ext_contentscript_permission.html]
 skip-if = tsan # Times out on TSan, bug 1612707
@@ -124,16 +126,17 @@ skip-if = os == 'android' # Bug 1615427
 [test_ext_runtime_disconnect.html]
 [test_ext_sendmessage_doublereply.html]
 [test_ext_sendmessage_frameId.html]
 [test_ext_sendmessage_no_receiver.html]
 [test_ext_sendmessage_reply.html]
 [test_ext_sendmessage_reply2.html]
 skip-if = os == 'android'
 [test_ext_storage_manager_capabilities.html]
+skip-if = xorigin # JavaScript Error: "SecurityError: Permission denied to access property "wrappedJSObject" on cross-origin object" {file: "https://example.com/tests/SimpleTest/TestRunner.js" line: 157}
 scheme=https
 [test_ext_storage_smoke_test.html]
 [test_ext_streamfilter_multiple.html]
 skip-if = true #Bug 1628642
 [test_ext_streamfilter_processswitch.html]
 [test_ext_subframes_privileges.html]
 skip-if = os == 'android' || verify # bug 1489771
 [test_ext_tabs_sendMessage.html]
@@ -155,16 +158,17 @@ skip-if = (os == 'android' && debug) || 
 [test_ext_webnavigation_incognito.html]
 skip-if = os == 'android' # bug 1513544
 [test_ext_webrequest_and_proxy_filter.html]
 [test_ext_webrequest_auth.html]
 skip-if = os == 'android'
 [test_ext_webrequest_background_events.html]
 [test_ext_webrequest_basic.html]
 skip-if = os == 'android' && debug || tsan # bug 1397615. tsan: bug 1612707
+  || xorigin  # JavaScript Error: "SecurityError: Permission denied to access property "wrappedJSObject" on cross-origin object" {file: "http://mochi.false-test:8888/tests/SimpleTest/TestRunner.js" line: 157}]
 [test_ext_webrequest_errors.html]
 skip-if = tsan
 [test_ext_webrequest_filter.html]
 skip-if = os == 'android' && debug || tsan # bug 1452348. tsan: bug 1612707
 [test_ext_webrequest_frameId.html]
 skip-if = (webrender && os == 'linux') # Bug 1482983 caused by Bug 1480951
 [test_ext_webrequest_hsts.html]
 skip-if = os == 'android' || os == 'linux' || os == 'mac' #Bug 1605515
--- a/toolkit/components/passwordmgr/test/mochitest/mochitest.ini
+++ b/toolkit/components/passwordmgr/test/mochitest/mochitest.ini
@@ -25,157 +25,206 @@ support-files =
   pwmgr_common_parent.js
   ../authenticate.sjs
 skip-if = toolkit == 'android' && !is_fennec # Don't run on GeckoView
 
 # Note: new tests should use scheme = https unless they have a specific reason not to
 
 [test_autocomplete_basic_form.html]
 skip-if = toolkit == 'android' || debug && (os == 'linux' || os == 'win') || os == 'linux' && tsan # android:autocomplete. Bug 1541945, Bug 1590928
+  || xorigin
 scheme = https
 [test_autocomplete_basic_form_insecure.html]
 skip-if = toolkit == 'android' || os == 'linux' # android:autocomplete., linux: bug 1325778
 [test_autocomplete_basic_form_formActionOrigin.html]
 skip-if = toolkit == 'android' # android:autocomplete.
+  || xorigin # JavaScript error: resource://gre/modules/Finder.jsm, line 58: SecurityError: Permission denied to access property "addEventListener" on cross-origin object
 scheme = https
 [test_autocomplete_basic_form_subdomain.html]
 skip-if = toolkit == 'android' # android:autocomplete.
+  || xorigin # Hangs
 scheme = https
 [test_autocomplete_hasBeenTypePassword.html]
 scheme = https
 skip-if = toolkit == 'android' # autocomplete
+  || xorigin # Hangs
 [test_autocomplete_highlight.html]
 scheme = https
 skip-if = toolkit == 'android' # autocomplete
+  || xorigin # Hangs
 [test_autocomplete_highlight_non_login.html]
 scheme = https
 skip-if = toolkit == 'android' # autocomplete
+  || xorigin # Hangs
 [test_autocomplete_https_downgrade.html]
 scheme = http # Tests downgrading
 skip-if = toolkit == 'android'  || (os == 'linux' && debug) # autocomplete && Bug 1554959 for linux debug disable
+  || xorigin # Hangs
 [test_autocomplete_https_upgrade.html]
 scheme = https
 skip-if = toolkit == 'android'  || (os == 'linux' && debug) # autocomplete && Bug 1554959 for linux debug disable
+  || xorigin # Hangs
 [test_autocomplete_password_generation.html]
 scheme = https
 skip-if = toolkit == 'android' # autocomplete
+  || xorigin # Hangs
 [test_autocomplete_password_generation_confirm.html]
 scheme = https
 skip-if = toolkit == 'android' # autocomplete
 [test_autocomplete_password_open.html]
 scheme = https
 skip-if = toolkit == 'android' || verify # autocomplete
+  || xorigin # Hangs
 [test_autocomplete_sandboxed.html]
 scheme = https
 skip-if = toolkit == 'android' # autocomplete
 [test_autocomplete_tab_between_fields.html]
 scheme = https
 skip-if = toolkit == 'android' # autocomplete
+  || xorigin # Hangs
 [test_autofill_autocomplete_types.html]
 scheme = https
 skip-if = toolkit == 'android' # bug 1533965
+  || xorigin # Hangs
 [test_autofill_different_formActionOrigin.html]
 scheme = https
 skip-if = toolkit == 'android' # Bug 1259768
+  || xorigin # Hangs
 [test_autofill_different_subdomain.html]
 scheme = https
 skip-if = toolkit == 'android' # Bug 1259768
+  || xorigin # Hangs
 [test_autofill_from_bfcache.html]
 fail-if = fission
 scheme = https
 skip-if = toolkit == 'android' # bug 1527403
 [test_autofill_hasBeenTypePassword.html]
 scheme = https
+skip-if = xorigin # Hangs
 [test_autofill_highlight.html]
 scheme = https
 skip-if = toolkit == 'android' # Bug 1531185
+  || xorigin # Hangs
 [test_autofill_highlight_empty_username.html]
 scheme = https
 [test_autofill_https_downgrade.html]
 scheme = http  # we need http to test handling of https logins on http forms
+skip-if = xorigin # Hangs
 [test_autofill_https_upgrade.html]
 skip-if = toolkit == 'android' # Bug 1259768
+  || xorigin # Hangs
 [test_autofill_sandboxed.html]
 scheme = https
 skip-if = toolkit == 'android'
 [test_autofill_password-only.html]
+skip-if = xorigin # Hangs
 [test_autofocus_js.html]
 scheme = https
 skip-if = toolkit == 'android' # autocomplete
+  || xorigin # Hangs
 [test_basic_form.html]
+skip-if = xorigin # Hangs
 [test_basic_form_0pw.html]
+skip-if = xorigin # Hangs
 [test_basic_form_1pw.html]
+skip-if = xorigin # Hangs
 [test_basic_form_1pw_2.html]
+skip-if = xorigin # Hangs
 [test_basic_form_2pw_1.html]
+skip-if = xorigin # Hangs
 [test_basic_form_2pw_2.html]
+skip-if = xorigin # Hangs
 [test_basic_form_3pw_1.html]
+skip-if = xorigin # Hangs
 [test_basic_form_honor_autocomplete_off.html]
 scheme = https
 skip-if = toolkit == 'android' # android:autocomplete.
+  || xorigin # Hangs
 [test_password_field_autocomplete.html]
 skip-if = toolkit == 'android' # android:autocomplete.
+  || xorigin # Hangs
 [test_insecure_form_field_no_saved_login.html]
 skip-if = toolkit == 'android' # android:autocomplete.
 [test_basic_form_html5.html]
+skip-if = xorigin # Hangs
 [test_basic_form_pwevent.html]
+skip-if = xorigin # Hangs
 [test_basic_form_pwonly.html]
+skip-if = xorigin # Hangs
 [test_bug_627616.html]
 skip-if = toolkit == 'android' # Tests desktop prompts
 [test_bug_776171.html]
 [test_case_differences.html]
 skip-if = toolkit == 'android' # autocomplete
+  || xorigin # Hangs
 scheme = https
 [test_form_action_1.html]
+skip-if = xorigin # Hangs
 [test_form_action_2.html]
+skip-if = xorigin # Hangs
 [test_form_action_javascript.html]
+skip-if = xorigin # JavaScript error: http://mochi.xorigin-test:8888/tests/SimpleTest/TestRunner.js, line 157: SecurityError: Permission denied to access property "wrappedJSObject" on cross-origin object
 [test_formless_autofill.html]
+skip-if = xorigin # Hangs
 [test_formless_submit.html]
 skip-if = toolkit == 'android' && debug # bug 1397615
+  || xorigin # Hangs
 [test_formless_submit_navigation.html]
 skip-if = toolkit == 'android' && debug # bug 1397615
+  || xorigin # Hangs
 [test_formless_submit_navigation_negative.html]
 skip-if = toolkit == 'android' && debug # bug 1397615
+  || xorigin # Hangs
 [test_input_events.html]
 [test_input_events_for_identical_values.html]
 [test_LoginManagerContent_passwordEditedOrGenerated.html]
 scheme = https
 skip-if = toolkit == 'android' # password generation
+  || xorigin # Hangs
 [test_master_password.html]
 scheme = https
 skip-if = os != 'mac' || verify # Tests desktop prompts and bug 1333264
 support-files =
   chrome_timeout.js
   subtst_master_pass.html
 [test_maxlength.html]
+skip-if = xorigin # Hangs
 [test_munged_values.html]
 scheme = https
 skip-if = toolkit == 'android' # bug 1527403
+  || xorigin # Hangs
 [test_one_doorhanger_per_un_pw.html]
 scheme = https
 skip-if = toolkit == 'android' # bug 1535505
 [test_onsubmit_value_change.html]
 [test_passwords_in_type_password.html]
+skip-if = xorigin # Hangs
 [test_prompt.html]
 skip-if = os == "linux" || toolkit == 'android' # Tests desktop prompts
+  || xorigin # Hangs
 [test_prompt_async.html]
 skip-if = toolkit == 'android' || (debug || asan || tsan) # Tests desktop prompts # Bug 1603659
 support-files = subtst_prompt_async.html
 [test_prompt_http.html]
 skip-if = os == "linux" || toolkit == 'android' # Tests desktop prompts
 [test_prompt_noWindow.html]
 skip-if = toolkit == 'android' # Tests desktop prompts.
 [test_password_length.html]
 scheme = https
 skip-if = toolkit == 'android' # bug 1527403
+  || xorigin # Hangs
 [test_prompt_promptAuth.html]
 skip-if = os == "linux" || toolkit == 'android' # Tests desktop prompts
 [test_prompt_promptAuth_proxy.html]
 skip-if = e10s || os == "linux" || toolkit == 'android' # Tests desktop prompts
 [test_recipe_login_fields.html]
 [test_submit_without_field_modifications.html]
 support-files =
   subtst_prefilled_form.html
+skip-if = xorigin # Hangs
 [test_username_focus.html]
 skip-if = toolkit == 'android' # android:autocomplete.
+  || xorigin # Hangs
 [test_xhr.html]
 skip-if = toolkit == 'android' # Tests desktop prompts
+fail-if = xorigin
 [test_xhr_2.html]
 
--- a/toolkit/components/prompts/test/mochitest.ini
+++ b/toolkit/components/prompts/test/mochitest.ini
@@ -4,12 +4,15 @@ support-files =
   bug619644_inner.html
   bug625187_iframe.html
   prompt_common.js
   chromeScript.js
 
 [test_bug619644.html]
 [test_bug620145.html]
 skip-if = toolkit == 'android' #TIMED_OUT
+fail-if = xorigin
 [test_subresources_prompts.html]
 skip-if = toolkit == 'android' || verify
+fail-if = xorigin
 [test_dom_prompts.html]
 skip-if = toolkit == 'android' #android: bug 1267092
+fail-if = xorigin
--- a/toolkit/components/url-classifier/tests/mochitest/mochitest.ini
+++ b/toolkit/components/url-classifier/tests/mochitest/mochitest.ini
@@ -47,11 +47,12 @@ skip-if = (verify && debug && (os == 'wi
 [test_gethash.html]
 [test_bug1254766.html]
 [test_cachemiss.html]
 skip-if = verify
 [test_annotation_vs_TP.html]
 [test_fingerprinting.html]
 [test_fingerprinting_annotate.html]
 [test_cryptomining.html]
+skip-if = xorigin # Crashes at runtests.py: IOError: [Errno 2] No such file or directory: u'/builds/worker/workspace/build/symbols/libc.so.6/BAC017B4C57C06CFD1D1BED6652CEDB90/libc.so.6.sym'
 [test_cryptomining_annotate.html]
 [test_socialtracking.html]
 [test_socialtracking_annotate.html]
--- a/toolkit/content/tests/mochitest/mochitest.ini
+++ b/toolkit/content/tests/mochitest/mochitest.ini
@@ -4,9 +4,10 @@
 skip-if = toolkit == "android"
 [test_mousecapture.xhtml]
 support-files =
   file_mousecapture.html
   file_mousecapture2.html
   file_mousecapture3.html
   file_mousecapture4.html
   file_mousecapture5.html
-skip-if = (toolkit == "android")
+skip-if = toolkit == "android"
+  || xorigin # SecurityError: Permission denied to access property "scrollX" on cross-origin object at runTests@http://mochi.test:8888/tests/toolkit/content/tests/mochitest/test_mousecapture.xhtml:170:17, inconsistent fail/pass
--- a/toolkit/content/tests/widgets/mochitest.ini
+++ b/toolkit/content/tests/widgets/mochitest.ini
@@ -19,33 +19,35 @@ support-files =
   videocontrols_direction-2c.html
   videocontrols_direction-2d.html
   videocontrols_direction-2e.html
   videocontrols_direction_test.js
   videomask.css
 
 [test_audiocontrols_dimensions.html]
 [test_mousecapture_area.html]
-skip-if = (verify && debug)
+skip-if = (xorigin && debug) || (verify && debug)
 [test_ua_widget_sandbox.html]
 [test_ua_widget_unbind.html]
 [test_videocontrols.html]
 tags = fullscreen
 skip-if = toolkit == 'android' || (verify && debug && (os == 'linux')) || (webrender && (os == 'linux')) #TIMED_OUT #Bug 1484210 #Bug 1511256
 [test_videocontrols_keyhandler.html]
 skip-if = (toolkit == 'android') || (os == 'linux') #Bug 1366957
 [test_videocontrols_vtt.html]
 [test_videocontrols_iframe_fullscreen.html]
 [test_videocontrols_size.html]
 [test_videocontrols_audio.html]
 [test_videocontrols_audio_direction.html]
+skip-if = xorigin # Rendering of reftest videocontrols_direction-2a.html should not be different to the reference, fails/passes inconsistently
 [test_videocontrols_jsdisabled.html]
 skip-if = toolkit == 'android' # bug 1272646
 [test_videocontrols_standalone.html]
 skip-if = toolkit == 'android' # bug 1075573
 [test_videocontrols_video_direction.html]
 skip-if = os == 'win'
+  || xorigin # Rendering of reftest videocontrols_direction-2a.html should not be different to the reference, fails/passes inconsistently
 [test_videocontrols_video_noaudio.html]
 [test_bug898940.html]
 skip-if = (os == "win" && processor == "aarch64") # aarch64 due to 1536347
 [test_videocontrols_error.html]
 [test_videocontrols_orientation.html]
 skip-if = true # Bug 1483656