Skip to content

Commit

Permalink
Backed out 2 changesets (bug 1481021) for bc failures on security/san…
Browse files Browse the repository at this point in the history
…dbox/test/browser_bug1393259.js.

Backed out changeset c53c7b0249ad (bug 1481021)
Backed out changeset 41bedc526dd6 (bug 1481021)
  • Loading branch information
cristianbrindusan committed Aug 8, 2018
1 parent a8579f9 commit 16ec846
Show file tree
Hide file tree
Showing 20 changed files with 80 additions and 124 deletions.
2 changes: 0 additions & 2 deletions browser/base/content/test/general/browser_gZipOfflineChild.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ registerCleanupFunction(function() {
// offline cache events.
//
function contentTask() {
ChromeUtils.import("resource://gre/modules/Timer.jsm");

let resolve;
let promise = new Promise(r => { resolve = r; });

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ const whitelist = {
]),
modules: new Set([
"chrome://mochikit/content/ShutdownLeaksCollector.jsm",
"resource://specialpowers/specialpowers.js",
"resource://specialpowers/specialpowersAPI.js",

// General utilities
"resource://gre/modules/AppConstants.jsm",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ add_task(async function test_displayURI_camera() {

add_task(async function test_displayURI_geo_blob() {
await check(async function() {
Cu.importGlobalProperties(["Blob"]);
let text = "<script>navigator.geolocation.getCurrentPosition(() => {})</script>";
let blob = new Blob([text], {type: "text/html"});
let url = content.URL.createObjectURL(blob);
Expand All @@ -102,7 +101,6 @@ add_task(async function test_displayURI_geo_blob() {

add_task(async function test_displayURI_camera_blob() {
await check(async function() {
Cu.importGlobalProperties(["Blob"]);
let text = "<script>navigator.mediaDevices.getUserMedia({video: true, fake: true})</script>";
let blob = new Blob([text], {type: "text/html"});
let url = content.URL.createObjectURL(blob);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

/* eslint-env mozilla/frame-script */

ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyServiceGetter(this, "MediaManagerService",
"@mozilla.org/mediaManagerService;1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ test_newtab({
// it should be able to click the topsites edit button to reveal the edit topsites modal and overlay.
test: async function topsites_add() {
let nativeInputValueSetter = Object.getOwnPropertyDescriptor(content.window.HTMLInputElement.prototype, "value").set;
let event = new content.Event("input", {bubbles: true});
let event = new Event("input", {bubbles: true});

// Find the add topsites button
content.document.querySelector(".top-sites .section-top-bar .context-menu-button").click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,12 @@ let PaymentFrameScript = {
},

getDefaultPreferences() {
let prefValues = Cu.cloneInto({
let prefValues = {
saveCreditCardDefaultChecked:
Services.prefs.getBoolPref(SAVE_CREDITCARD_DEFAULT_PREF, false),
saveAddressDefaultChecked:
Services.prefs.getBoolPref(SAVE_ADDRESS_DEFAULT_PREF, false),
}, waivedContent);
};
return prefValues;
},
};
Expand Down
6 changes: 3 additions & 3 deletions browser/components/uitour/test/head.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ function loadUITourTestPage(callback, host = "https://example.org/") {
let callbacksCalled = 0;
let resolveCallbackPromise;
let allCallbacksCalledPromise = new Promise(resolve => resolveCallbackPromise = resolve);
let argumentsWithFunctions = Cu.cloneInto(contentArgs.args.map((arg, index) => {
let argumentsWithFunctions = contentArgs.args.map((arg, index) => {
if (arg === "" && contentArgs.fnIndices.includes(index)) {
return function() {
callbacksCalled++;
Expand All @@ -334,9 +334,9 @@ function loadUITourTestPage(callback, host = "https://example.org/") {
};
}
return arg;
}), content, {cloneFunctions: true});
});
let rv = contentWin.Mozilla.UITour[contentArgs.methodName].apply(contentWin.Mozilla.UITour,
argumentsWithFunctions);
argumentsWithFunctions);
if (contentArgs.fnIndices.length) {
await allCallbacksCalledPromise;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ this.call = function (name, args) {
dump("Calling function with name " + name + ".\n");

dump("args " + JSON.stringify(args) + "\n");
return XPCNativeWrapper.unwrap(content)[name].apply(undefined, Cu.cloneInto(args, content));
return XPCNativeWrapper.unwrap(content)[name].apply(undefined, args);
};

this._eval = function (string) {
Expand Down
2 changes: 2 additions & 0 deletions docshell/test/chrome/bug89419_window.xul
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
title="bug 89419 test">

<script type="application/javascript" src= "chrome://mochikit/content/chrome-harness.js" />
<script type="text/javascript"
src="chrome://mochikit/content/tests/SimpleTest/specialpowersAPI.js"/>
<script type="text/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SpecialPowersObserverAPI.js"/>
<script type="text/javascript"
Expand Down
2 changes: 0 additions & 2 deletions dom/cache/test/mochitest/browser_cache_pb_window.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ function testKeys(browser) {

function testOpen_worker(browser) {
return ContentTask.spawn(browser, {}, function() {
Cu.importGlobalProperties(["Blob"]);

let workerFunctionString = function () {
caches.open("pb-worker-cache").then(function(cacheObject) {
postMessage(cacheObject.toString());
Expand Down
7 changes: 0 additions & 7 deletions dom/file/ipc/tests/browser_ipcBlob.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ add_task(async function test_CtoPtoC_big() {
let browser1 = gBrowser.getBrowserForTab(tab1);

let blob = await ContentTask.spawn(browser1, null, function() {
Cu.importGlobalProperties(["Blob"]);
let blob = new Blob([new Array(1024*1024).join('123456789ABCDEF')]);
return blob;
});
Expand Down Expand Up @@ -44,7 +43,6 @@ add_task(async function test_CtoPtoC_small() {
let browser1 = gBrowser.getBrowserForTab(tab1);

let blob = await ContentTask.spawn(browser1, null, function() {
Cu.importGlobalProperties(["Blob"]);
let blob = new Blob(["hello world!"]);
return blob;
});
Expand Down Expand Up @@ -77,7 +75,6 @@ add_task(async function test_CtoPtoC_bc_big() {
let browser1 = gBrowser.getBrowserForTab(tab1);

await ContentTask.spawn(browser1, null, function() {
Cu.importGlobalProperties(["Blob"]);
var bc = new content.BroadcastChannel('test');
bc.onmessage = function() {
bc.postMessage(new Blob([new Array(1024*1024).join('123456789ABCDEF')]));
Expand Down Expand Up @@ -114,7 +111,6 @@ add_task(async function test_CtoPtoC_bc_small() {
let browser1 = gBrowser.getBrowserForTab(tab1);

await ContentTask.spawn(browser1, null, function() {
Cu.importGlobalProperties(["Blob"]);
var bc = new content.BroadcastChannel('test');
bc.onmessage = function() {
bc.postMessage(new Blob(["hello world!"]));
Expand Down Expand Up @@ -151,7 +147,6 @@ add_task(async function test_CtoPtoC_bc_small() {
let browser1 = gBrowser.getBrowserForTab(tab1);

let blobURL = await ContentTask.spawn(browser1, null, function() {
Cu.importGlobalProperties(["Blob"]);
return content.URL.createObjectURL(new content.Blob(["hello world!"]));
});

Expand Down Expand Up @@ -182,7 +177,6 @@ add_task(async function test_CtoPtoC_multipart() {
let browser1 = gBrowser.getBrowserForTab(tab1);

let blob = await ContentTask.spawn(browser1, null, function() {
Cu.importGlobalProperties(["Blob"]);
return new Blob(["!"]);
});

Expand All @@ -195,7 +189,6 @@ add_task(async function test_CtoPtoC_multipart() {
let browser2 = gBrowser.getBrowserForTab(tab2);

let status = await ContentTask.spawn(browser2, newBlob, function(blob) {
Cu.importGlobalProperties(["Blob"]);
return new Promise(resolve => {
let fr = new content.FileReader();
fr.readAsText(new Blob(["hello ", blob]));
Expand Down
2 changes: 1 addition & 1 deletion dom/html/test/browser_fullscreen-api-keys.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function frameScript() {
});
addMessageListener("Test:DispatchUntrustedKeyEvents", msg => {
var evt = new content.CustomEvent("Test:DispatchKeyEvents", {
detail: Cu.cloneInto({ code: msg.data }, content),
detail: { code: msg.data }
});
content.dispatchEvent(evt);
});
Expand Down
2 changes: 1 addition & 1 deletion dom/tests/browser/browser_localStorage_e10s.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ async function mutateTabStorage(knownTab, mutations, sentinelValue) {
knownTab.tab.linkedBrowser,
{ mutations, sentinelValue },
function(args) {
return content.wrappedJSObject.mutateStorage(Cu.cloneInto(args, content));
return content.wrappedJSObject.mutateStorage(args);
});
}

Expand Down
12 changes: 1 addition & 11 deletions js/xpconnect/tests/mochitest/test_bug628410.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,7 @@
<script type="application/javascript">

/** Test for Bug 628410 **/
{
// window.toSource() will throw if SpecialPowers is defined on the window and
// permissive COWs are not enabled for the global that owns its frame message
// manager.
let sp = window.SpecialPowers;
window.SpecialPowers = null;

window.toSource();
window.SpecialPowers = sp;
}

window.toSource();
window.toString();
InstallTrigger + "";
console + "";
Expand Down
2 changes: 1 addition & 1 deletion testing/mochitest/tests/SimpleTest/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ if (params.runUntilFailure) {

// closeWhenDone tells us to close the browser when complete
if (params.closeWhenDone) {
TestRunner.onComplete = SpecialPowers.quit.bind(SpecialPowers);
TestRunner.onComplete = SpecialPowers.quit;
}

if (params.failureFile) {
Expand Down
5 changes: 4 additions & 1 deletion testing/specialpowers/content/SpecialPowersObserver.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ var EXPORTED_SYMBOLS = ["SpecialPowersObserver"];
ChromeUtils.import("resource://gre/modules/Services.jsm");
Cu.importGlobalProperties(["File"]);

const CHILD_SCRIPT_API = "resource://specialpowers/specialpowersFrameScript.js";
const CHILD_SCRIPT = "resource://specialpowers/specialpowers.js";
const CHILD_SCRIPT_API = "resource://specialpowers/specialpowersAPI.js";
const CHILD_LOGGER_SCRIPT = "resource://specialpowers/MozillaLogger.js";


Expand Down Expand Up @@ -81,6 +82,7 @@ SpecialPowersObserver.prototype._loadFrameScript = function() {

this._messageManager.loadFrameScript(CHILD_LOGGER_SCRIPT, true);
this._messageManager.loadFrameScript(CHILD_SCRIPT_API, true);
this._messageManager.loadFrameScript(CHILD_SCRIPT, true);
this._isFrameScriptLoaded = true;
this._createdFiles = null;
}
Expand Down Expand Up @@ -147,6 +149,7 @@ SpecialPowersObserver.prototype.uninit = function() {

this._messageManager.removeDelayedFrameScript(CHILD_LOGGER_SCRIPT);
this._messageManager.removeDelayedFrameScript(CHILD_SCRIPT_API);
this._messageManager.removeDelayedFrameScript(CHILD_SCRIPT);
this._isFrameScriptLoaded = false;
}
};
Expand Down
Loading

0 comments on commit 16ec846

Please sign in to comment.