Bug 863246 - Fix test failures
MozReview-Commit-ID: 2fdpZhHpgmM
--- a/browser/base/content/test/static/browser_all_files_referenced.js
+++ b/browser/base/content/test/static/browser_all_files_referenced.js
@@ -163,17 +163,21 @@ var whitelist = [
// Bug 1351079
{file: "resource://gre/modules/ISO8601DateUtils.jsm"},
// Bug 1337345
{file: "resource://gre/modules/Manifest.jsm"},
// Bug 1351097
{file: "resource://gre/modules/accessibility/AccessFu.jsm"},
// Bug 1351637
{file: "resource://gre/modules/sdk/bootstrap.js"},
-
+ // dom/html/ImageDocument.cpp
+ {file: "resource://content-accessible/ImageDocument.css"},
+ {file: "resource://content-accessible/TopLevelImageDocument.css"},
+ // dom/html/VideoDocument.cpp
+ {file: "resource://content-accessible/TopLevelVideoDocument.css"},
];
if (!AppConstants.MOZ_PHOTON_THEME) {
whitelist.push(
// Bug 1343824
{file: "chrome://browser/skin/customizableui/customize-illustration-rtl@2x.png",
platforms: ["linux", "win"]},
{file: "chrome://browser/skin/customizableui/customize-illustration@2x.png",
@@ -544,16 +548,18 @@ add_task(async function checkAllTheFiles
// Wait for all the files to have actually loaded:
await Promise.all(allPromises);
// Keep only chrome:// files, and filter out either the devtools paths or
// the non-devtools paths:
let devtoolsPrefixes = ["chrome://webide/",
"chrome://devtools",
"resource://devtools/",
+ "resource://devtools-client-jsonview/",
+ "resource://devtools-client-shared/",
"resource://app/modules/devtools",
"resource://gre/modules/devtools"];
let chromeFiles = [];
for (let uri of uris) {
uri = convertToCodeURI(uri.spec);
if ((uri.startsWith("chrome://") || uri.startsWith("resource://")) &&
isDevtools == devtoolsPrefixes.some(prefix => uri.startsWith(prefix)))
chromeFiles.push(uri);
--- a/browser/base/content/test/static/browser_parsable_css.js
+++ b/browser/base/content/test/static/browser_parsable_css.js
@@ -12,17 +12,17 @@
let whitelist = [
// CodeMirror is imported as-is, see bug 1004423.
{sourceName: /codemirror\.css$/i,
isFromDevTools: true},
// The debugger uses cross-browser CSS.
{sourceName: /devtools\/client\/debugger\/new\/debugger.css/i,
isFromDevTools: true},
// Reps uses cross-browser CSS.
- {sourceName: /devtools\/client\/shared\/components\/reps\/reps.css/i,
+ {sourceName: /devtools-client-shared\/components\/reps\/reps.css/i,
isFromDevTools: true},
// PDFjs is futureproofing its pseudoselectors, and those rules are dropped.
{sourceName: /web\/viewer\.css$/i,
errorMessage: /Unknown pseudo-class.*(fullscreen|selection)/i,
isFromDevTools: false},
// PDFjs rules needed for compat with other UAs.
{sourceName: /web\/viewer\.css$/i,
errorMessage: /Unknown property.*appearance/i,
--- a/caps/tests/mochitest/test_bug292789.html
+++ b/caps/tests/mochitest/test_bug292789.html
@@ -95,13 +95,18 @@ function loadImage(uri, expect, callback
img.onload = success;
img.expected = expect;
img.callback = callback;
img.src = uri;
// document.getElementById("content").appendChild(img);
}
// Start off the script src test, and have it start the img tests when complete.
-testScriptSrc(runImgTest);
+// Temporarily allow content to access all resource:// URIs.
+SpecialPowers.pushPrefEnv({
+ set: [
+ ["security.all_resource_uri_content_accessible", true]
+ ]
+}, () => testScriptSrc(runImgTest));
</script>
</pre>
</body>
</html>
--- a/devtools/client/debugger/test/mochitest/browser_dbg_worker-source-map.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_worker-source-map.js
@@ -15,16 +15,19 @@ function selectWorker(aPanel, aURL) {
return workerForm.url === aURL;
});
Workers.selectedItem = item;
return promise;
}
function test() {
return Task.spawn(function* () {
+ // Temporarily allow content to access all resource:// URIs.
+ yield pushPrefs(["security.all_resource_uri_content_accessible", true]);
+
yield pushPrefs(["devtools.debugger.workers", true]);
let options = {
source: TAB_URL,
line: 1
};
let [tab,, panel] = yield initDebugger(TAB_URL, options);
let toolbox = yield selectWorker(panel, WORKER_URL);
--- a/devtools/client/debugger/test/mochitest/head.js
+++ b/devtools/client/debugger/test/mochitest/head.js
@@ -1052,17 +1052,22 @@ function evalInTab(tab, string) {
info("Evalling string in tab.");
return jsonrpc(tab, "_eval", [string]);
}
function createWorkerInTab(tab, url) {
info("Creating worker with url '" + url + "' in tab.");
- return jsonrpc(tab, "createWorker", [url]);
+ // Temporarily allow content to access all resource:// URIs.
+ return SpecialPowers.pushPrefEnv({
+ set: [
+ ["security.all_resource_uri_content_accessible", true]
+ ]
+ }).then(() => jsonrpc(tab, "createWorker", [url]));
}
function terminateWorkerInTab(tab, url) {
info("Terminating worker with url '" + url + "' in tab.");
return jsonrpc(tab, "terminateWorker", [url]);
}
--- a/devtools/client/shared/shim/test/test_service_appinfo.html
+++ b/devtools/client/shared/shim/test/test_service_appinfo.html
@@ -12,17 +12,17 @@ https://bugzilla.mozilla.org/show_bug.cg
<script type="application/javascript">
"use strict";
var exports = {}
var module = {exports};
</script>
<script type="application/javascript"
- src="resource://devtools/client/shared/shim/Services.js"></script>
+ src="resource://devtools-client-shared/shim/Services.js"></script>
</head>
<body>
<script type="application/javascript">
"use strict";
is(Services.appinfo.OS, SpecialPowers.Services.appinfo.OS,
"check that Services.appinfo.OS shim matches platform");
</script>
--- a/devtools/client/shared/shim/test/test_service_focus.html
+++ b/devtools/client/shared/shim/test/test_service_focus.html
@@ -12,17 +12,17 @@ https://bugzilla.mozilla.org/show_bug.cg
<script type="application/javascript">
"use strict";
var exports = {}
var module = {exports};
</script>
<script type="application/javascript"
- src="resource://devtools/client/shared/shim/Services.js"></script>
+ src="resource://devtools-client-shared/shim/Services.js"></script>
</head>
<body>
<span>
<span id="start" testvalue="0" tabindex="0"> </span>
<label>
<input testvalue="1" type="radio">Hi</input>
</label>
<label>
--- a/devtools/client/shared/shim/test/test_service_prefs.html
+++ b/devtools/client/shared/shim/test/test_service_prefs.html
@@ -40,17 +40,17 @@ localStorage.setItem("Services.prefs:dev
userValue: null
}));
</script>
<script type="application/javascript"
src="prefs-wrapper.js"></script>
<script type="application/javascript"
- src="resource://devtools/client/shared/shim/Services.js"></script>
+ src="resource://devtools-client-shared/shim/Services.js"></script>
</head>
<body>
<script type="application/javascript">
"use strict";
function do_tests() {
// We can't load the defaults in this context.
Services._defaultPrefsEnabled = false;
--- a/devtools/client/shared/shim/test/test_service_prefs_defaults.html
+++ b/devtools/client/shared/shim/test/test_service_prefs_defaults.html
@@ -39,17 +39,17 @@ localStorage.setItem("Services.prefs:pre
defaultValue: "pref3default",
hasUserValue: true,
userValue: "glass winged butterfly"
}));
</script>
<script type="application/javascript"
- src="resource://devtools/client/shared/shim/Services.js"></script>
+ src="resource://devtools-client-shared/shim/Services.js"></script>
</head>
<body>
<script type="application/javascript">
"use strict";
is(Services.prefs.getCharPref("pref1"), "pref1default", "pref1 value");
is(Services.prefs.getCharPref("pref2"), "pref2default", "pref2 value");
is(Services.prefs.getCharPref("pref2.sub1"), "pref2sub1default", "pref2 sub1 value");
--- a/devtools/client/shared/shim/test/test_service_wm.html
+++ b/devtools/client/shared/shim/test/test_service_wm.html
@@ -12,17 +12,17 @@ https://bugzilla.mozilla.org/show_bug.cg
<script type="application/javascript">
"use strict";
var exports = {}
var module = {exports};
</script>
<script type="application/javascript"
- src="resource://devtools/client/shared/shim/Services.js"></script>
+ src="resource://devtools-client-shared/shim/Services.js"></script>
</head>
<body>
<script type="application/javascript">
"use strict";
function hurray(window) {
ok(true, "window loaded");
--- a/devtools/shared/platform/content/test/test_clipboard.html
+++ b/devtools/shared/platform/content/test/test_clipboard.html
@@ -10,32 +10,47 @@ https://bugzilla.mozilla.org/show_bug.cg
<link rel="stylesheet" type="text/css"
href="chrome://mochikit/content/tests/SimpleTest/test.css">
<script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
<script type="application/javascript">
"use strict";
var exports = {}
</script>
-
- <script type="application/javascript"
- src="resource://devtools/shared/platform/content/clipboard.js"></script>
-
</head>
-<body onload="do_tests()">
+<body onload="pre_do_tests()">
<script type="application/javascript">
"use strict";
const RESULT = "lark bunting";
function doCopy(e) {
console.log(e.isTrusted);
copyString(RESULT);
}
+async function pre_do_tests() {
+ // Temporarily allow content to access all resource:// URIs.
+ await SpecialPowers.pushPrefEnv({
+ set: [
+ ["security.all_resource_uri_content_accessible", true]
+ ]
+ });
+
+ // Load script.
+ await (() => new Promise((aResolve) => {
+ var script = document.createElement("script");
+ script.onload = aResolve;
+ script.src = "resource://devtools/shared/platform/content/clipboard.js";
+ document.head.appendChild(script);
+ }))();
+
+ do_tests();
+}
+
function do_tests() {
let elt = document.querySelector("#key");
elt.addEventListener("keydown", doCopy);
// Set the clipboard to something other than what we expect.
SpecialPowers.clipboardCopyString("snowy owl");
elt.focus();
--- a/dom/security/test/mixedcontentblocker/test_bug803225.html
+++ b/dom/security/test/mixedcontentblocker/test_bug803225.html
@@ -14,18 +14,21 @@ https://bugzilla.mozilla.org/show_bug.cg
var counter = 0;
var settings = [ [true, true], [true, false], [false, true], [false, false] ];
var blockActive;
var blockDisplay;
//Cycle through 4 different preference settings.
function changePrefs(callback) {
- let newPrefs = [["security.mixed_content.block_display_content", settings[counter][0]],
- ["security.mixed_content.block_active_content", settings[counter][1]]];
+ let newPrefs = [
+ ["security.all_resource_uri_content_accessible", true], // Temporarily allow content to access all resource:// URIs.
+ ["security.mixed_content.block_display_content", settings[counter][0]],
+ ["security.mixed_content.block_active_content", settings[counter][1]]
+ ];
SpecialPowers.pushPrefEnv({"set": newPrefs}, function () {
blockDisplay = SpecialPowers.getBoolPref("security.mixed_content.block_display_content");
blockActive = SpecialPowers.getBoolPref("security.mixed_content.block_active_content");
counter++;
callback();
});
}