diff options
author | wolfbeast <mcwerewolf@wolfbeast.com> | 2020-04-14 21:49:04 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2020-04-14 21:49:04 +0200 |
commit | 39dac57259cff8b61db0b22cb2ad0a8adb02692e (patch) | |
tree | 52a026cc8c22793eb17fd0f5e22adce1ae08a1dd /toolkit/components/satchel/test/browser/browser_privbrowsing_perwindowpb.js | |
parent | a1cce3b2b00bbd9f4983013ddd8934a7bccb9e99 (diff) | |
parent | c2d9ab62f3d097c9e0e00184cab1f546554f5eaa (diff) | |
download | UXP-39dac57259cff8b61db0b22cb2ad0a8adb02692e.tar UXP-39dac57259cff8b61db0b22cb2ad0a8adb02692e.tar.gz UXP-39dac57259cff8b61db0b22cb2ad0a8adb02692e.tar.lz UXP-39dac57259cff8b61db0b22cb2ad0a8adb02692e.tar.xz UXP-39dac57259cff8b61db0b22cb2ad0a8adb02692e.zip |
Merge branch 'redwood' into 28.9-platform
Diffstat (limited to 'toolkit/components/satchel/test/browser/browser_privbrowsing_perwindowpb.js')
-rw-r--r-- | toolkit/components/satchel/test/browser/browser_privbrowsing_perwindowpb.js | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/toolkit/components/satchel/test/browser/browser_privbrowsing_perwindowpb.js b/toolkit/components/satchel/test/browser/browser_privbrowsing_perwindowpb.js deleted file mode 100644 index 982480648..000000000 --- a/toolkit/components/satchel/test/browser/browser_privbrowsing_perwindowpb.js +++ /dev/null @@ -1,63 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -var FormHistory = (Components.utils.import("resource://gre/modules/FormHistory.jsm", {})).FormHistory; - -/** Test for Bug 472396 **/ -add_task(function* test() { - // initialization - let windowsToClose = []; - let testURI = - "http://example.com/tests/toolkit/components/satchel/test/subtst_privbrowsing.html"; - - function* doTest(aShouldValueExist, aWindow) { - let browser = aWindow.gBrowser.selectedBrowser; - BrowserTestUtils.loadURI(browser, testURI); - yield BrowserTestUtils.browserLoaded(browser); - - // Wait for the page to reload itself. - yield BrowserTestUtils.browserLoaded(browser); - - let count = 0; - let doneCounting = {}; - doneCounting.promise = new Promise(resolve => doneCounting.resolve = resolve); - FormHistory.count({ fieldname: "field", value: "value" }, - { - handleResult(result) { - count = result; - }, - handleError(error) { - do_throw("Error occurred searching form history: " + error); - }, - handleCompletion(num) { - if (aShouldValueExist) { - is(count, 1, "In non-PB mode, we add a single entry"); - } else { - is(count, 0, "In PB mode, we don't add any entries"); - } - - doneCounting.resolve(); - } - }); - yield doneCounting.promise; - } - - function testOnWindow(aOptions, aCallback) { - return BrowserTestUtils.openNewBrowserWindow(aOptions) - .then(win => { windowsToClose.push(win); return win; }); - } - - - yield testOnWindow({private: true}).then((aWin) => { - return Task.spawn(doTest(false, aWin)); - }); - - // Test when not on private mode after visiting a site on private - // mode. The form history should not exist. - yield testOnWindow({}).then((aWin) => { - return Task.spawn(doTest(true, aWin)); - }); - - yield Promise.all(windowsToClose.map(win => BrowserTestUtils.closeWindow(win))); -}); |