browser/components/privatebrowsing/test/browser/browser_privatebrowsing_localStorage.js

Thu, 15 Jan 2015 21:13:52 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:13:52 +0100
branch
TOR_BUG_9701
changeset 12
7540298fafa1
permissions
-rw-r--r--

Remove forgotten relic of ABI crash risk averse overloaded method change.

michael@0 1 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 2 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 4
michael@0 5 function test() {
michael@0 6 requestLongerTimeout(2);
michael@0 7 waitForExplicitFinish();
michael@0 8
michael@0 9 const page1 = 'http://mochi.test:8888/browser/browser/components/privatebrowsing/test/browser/' +
michael@0 10 'browser_privatebrowsing_localStorage_page1.html'
michael@0 11
michael@0 12 function checkLocalStorage(aWindow, aCallback) {
michael@0 13 executeSoon(function() {
michael@0 14 let tab = aWindow.gBrowser.selectedTab = aWindow.gBrowser.addTab();
michael@0 15 let browser = aWindow.gBrowser.selectedBrowser;
michael@0 16 browser.addEventListener('load', function() {
michael@0 17 if (browser.contentWindow.location != page1) {
michael@0 18 browser.loadURI(page1);
michael@0 19 return;
michael@0 20 }
michael@0 21 browser.removeEventListener('load', arguments.callee, true);
michael@0 22 let tab2 = aWindow.gBrowser.selectedTab = aWindow.gBrowser.addTab();
michael@0 23 browser.contentWindow.location = 'http://mochi.test:8888/browser/browser/components/privatebrowsing/test/browser/' +
michael@0 24 'browser_privatebrowsing_localStorage_page2.html';
michael@0 25 browser.addEventListener('load', function() {
michael@0 26 browser.removeEventListener('load', arguments.callee, true);
michael@0 27 is(browser.contentWindow.document.title, '2', "localStorage should contain 2 items");
michael@0 28 aCallback();
michael@0 29 }, true);
michael@0 30 }, true);
michael@0 31 });
michael@0 32 }
michael@0 33
michael@0 34 let windowsToClose = [];
michael@0 35 function testOnWindow(options, callback) {
michael@0 36 let win = OpenBrowserWindow(options);
michael@0 37 win.addEventListener("load", function onLoad() {
michael@0 38 win.removeEventListener("load", onLoad, false);
michael@0 39 windowsToClose.push(win);
michael@0 40 callback(win);
michael@0 41 }, false);
michael@0 42 };
michael@0 43
michael@0 44 registerCleanupFunction(function() {
michael@0 45 windowsToClose.forEach(function(win) {
michael@0 46 win.close();
michael@0 47 });
michael@0 48 });
michael@0 49
michael@0 50 testOnWindow({private: true}, function(win) {
michael@0 51 checkLocalStorage(win, finish);
michael@0 52 });
michael@0 53
michael@0 54 }

mercurial