mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-27 10:57:34 +09:00
import FIREFOX_52_6_0esr_RELEASE from mozilla-esr52 hg repo
This commit is contained in:
commit
dcd9973243
150858 changed files with 23884658 additions and 0 deletions
69
dom/indexedDB/test/browser_perwindow_privateBrowsing.js
Normal file
69
dom/indexedDB/test/browser_perwindow_privateBrowsing.js
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
/**
|
||||
* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/
|
||||
*/
|
||||
|
||||
const testPageURL = "http://mochi.test:8888/browser/" +
|
||||
"dom/indexedDB/test/browser_permissionsPrompt.html";
|
||||
const notificationID = "indexedDB-permissions-prompt";
|
||||
|
||||
function test()
|
||||
{
|
||||
waitForExplicitFinish();
|
||||
// Avoids the actual prompt
|
||||
setPermission(testPageURL, "indexedDB");
|
||||
executeSoon(test1);
|
||||
}
|
||||
|
||||
function test1()
|
||||
{
|
||||
gBrowser.selectedTab = gBrowser.addTab();
|
||||
gBrowser.selectedBrowser.addEventListener("load", function () {
|
||||
if (content.location != testPageURL) {
|
||||
content.location = testPageURL;
|
||||
return;
|
||||
}
|
||||
gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
|
||||
|
||||
setFinishedCallback(function(isIDBDatabase, exception) {
|
||||
ok(isIDBDatabase,
|
||||
"First database creation was successful");
|
||||
ok(!exception, "No exception");
|
||||
gBrowser.removeCurrentTab();
|
||||
|
||||
executeSoon(test2);
|
||||
});
|
||||
}, true);
|
||||
content.location = testPageURL;
|
||||
}
|
||||
|
||||
function test2()
|
||||
{
|
||||
var win = OpenBrowserWindow({private: true});
|
||||
win.addEventListener("load", function onLoad() {
|
||||
win.removeEventListener("load", onLoad, false);
|
||||
executeSoon(() => test3(win));
|
||||
}, false);
|
||||
registerCleanupFunction(() => win.close());
|
||||
}
|
||||
|
||||
function test3(win)
|
||||
{
|
||||
win.gBrowser.selectedTab = win.gBrowser.addTab();
|
||||
win.gBrowser.selectedBrowser.addEventListener("load", function () {
|
||||
if (win.content.location != testPageURL) {
|
||||
win.content.location = testPageURL;
|
||||
return;
|
||||
}
|
||||
win.gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
|
||||
|
||||
setFinishedCallback(function(isIDBDatabase, exception) {
|
||||
ok(!isIDBDatabase, "No database");
|
||||
is(exception, "InvalidStateError", "Correct exception");
|
||||
win.gBrowser.removeCurrentTab();
|
||||
|
||||
executeSoon(finish);
|
||||
}, win);
|
||||
}, true);
|
||||
win.content.location = testPageURL;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue