зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1311247 - Avoid using unsafe CPOWs in browser_perwindow_privateBrowsing.js; r=mrbkap
This commit is contained in:
Родитель
9512e2b48d
Коммит
5caff82499
|
@ -19,7 +19,7 @@
|
|||
let event = yield undefined;
|
||||
|
||||
if (event.type == "success") {
|
||||
testResult = event.target.result;
|
||||
testResult = event.target.result instanceof IDBDatabase;
|
||||
}
|
||||
else {
|
||||
testException = event.target.error.name;
|
||||
|
|
|
@ -24,8 +24,8 @@ function test1()
|
|||
gBrowser.selectedBrowser.addEventListener("load", function () {
|
||||
gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
|
||||
|
||||
setFinishedCallback(function(result, exception) {
|
||||
ok(result instanceof IDBDatabase,
|
||||
setFinishedCallback(function(isIDBDatabase, exception) {
|
||||
ok(isIDBDatabase,
|
||||
"First database creation was successful");
|
||||
ok(!exception, "No exception");
|
||||
is(getPermission(testPageURL, "indexedDB"),
|
||||
|
@ -60,8 +60,8 @@ function test2()
|
|||
gBrowser.selectedBrowser.addEventListener("load", function () {
|
||||
gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
|
||||
|
||||
setFinishedCallback(function(result, exception) {
|
||||
ok(result instanceof IDBDatabase,
|
||||
setFinishedCallback(function(isIDBDatabase, exception) {
|
||||
ok(isIDBDatabase,
|
||||
"First database creation was successful");
|
||||
ok(!exception, "No exception");
|
||||
is(getPermission(testPageURL, "indexedDB"),
|
||||
|
|
|
@ -25,8 +25,8 @@ function test1()
|
|||
}
|
||||
gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
|
||||
|
||||
setFinishedCallback(function(result, exception) {
|
||||
ok(result instanceof IDBDatabase,
|
||||
setFinishedCallback(function(isIDBDatabase, exception) {
|
||||
ok(isIDBDatabase,
|
||||
"First database creation was successful");
|
||||
ok(!exception, "No exception");
|
||||
gBrowser.removeCurrentTab();
|
||||
|
@ -57,8 +57,8 @@ function test3(win)
|
|||
}
|
||||
win.gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
|
||||
|
||||
setFinishedCallback(function(result, exception) {
|
||||
ok(!result, "No database");
|
||||
setFinishedCallback(function(isIDBDatabase, exception) {
|
||||
ok(!isIDBDatabase, "No database");
|
||||
is(exception, "InvalidStateError", "Correct exception");
|
||||
win.gBrowser.removeCurrentTab();
|
||||
|
||||
|
|
|
@ -92,13 +92,16 @@ function setFinishedCallback(callback, win)
|
|||
if (!win) {
|
||||
win = window;
|
||||
}
|
||||
let testPage = win.gBrowser.selectedBrowser.contentWindow.wrappedJSObject;
|
||||
testPage.testFinishedCallback = function(result, exception) {
|
||||
setTimeout(function() {
|
||||
info("got finished callback");
|
||||
callback(result, exception);
|
||||
}, 0);
|
||||
}
|
||||
ContentTask.spawn(win.gBrowser.selectedBrowser, null, function*() {
|
||||
return yield new Promise(resolve => {
|
||||
content.wrappedJSObject.testFinishedCallback = (result, exception) => {
|
||||
info("got finished callback");
|
||||
resolve({result, exception});
|
||||
};
|
||||
});
|
||||
}).then(({result, exception}) => {
|
||||
callback(result, exception);
|
||||
});
|
||||
}
|
||||
|
||||
function dispatchEvent(eventName)
|
||||
|
|
Загрузка…
Ссылка в новой задаче