2012-11-09 00:30:48 +04:00
|
|
|
/**
|
|
|
|
* 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";
|
|
|
|
|
2017-07-20 10:10:30 +03:00
|
|
|
add_task(async function test1() {
|
2014-11-28 11:44:12 +03:00
|
|
|
// Avoids the actual prompt
|
|
|
|
setPermission(testPageURL, "indexedDB");
|
2012-11-09 00:30:48 +04:00
|
|
|
|
2017-07-20 10:10:30 +03:00
|
|
|
info("creating tab");
|
2017-05-15 22:49:50 +03:00
|
|
|
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
|
2012-11-09 00:30:48 +04:00
|
|
|
|
2017-07-20 10:10:30 +03:00
|
|
|
info("loading test page: " + testPageURL);
|
|
|
|
gBrowser.selectedBrowser.loadURI(testPageURL);
|
2012-11-09 00:30:48 +04:00
|
|
|
|
2017-07-20 10:10:30 +03:00
|
|
|
await waitForMessage(true, gBrowser);
|
|
|
|
gBrowser.removeCurrentTab();
|
|
|
|
});
|
2012-11-09 00:30:48 +04:00
|
|
|
|
2017-07-20 10:10:30 +03:00
|
|
|
add_task(async function test2() {
|
|
|
|
info("creating private window");
|
|
|
|
let win = await BrowserTestUtils.openNewBrowserWindow({ private: true });
|
2012-11-09 00:30:48 +04:00
|
|
|
|
2017-07-20 10:10:30 +03:00
|
|
|
info("creating tab");
|
2012-11-09 00:30:48 +04:00
|
|
|
win.gBrowser.selectedTab = win.gBrowser.addTab();
|
2017-07-20 10:10:30 +03:00
|
|
|
win.gBrowser.selectedBrowser.loadURI(testPageURL);
|
|
|
|
await waitForMessage("InvalidStateError", win.gBrowser);
|
|
|
|
win.gBrowser.removeCurrentTab();
|
|
|
|
await BrowserTestUtils.closeWindow(win);
|
|
|
|
win = null;
|
|
|
|
});
|