browser/components/sessionstore/test/browser_465215.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* This Source Code Form is subject to the terms of the Mozilla Public
     2  * License, v. 2.0. If a copy of the MPL was not distributed with this
     3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     5 function test() {
     6   /** Test for Bug 465215 **/
     8   waitForExplicitFinish();
    10   let uniqueName = "bug 465215";
    11   let uniqueValue1 = "as good as unique: " + Date.now();
    12   let uniqueValue2 = "as good as unique: " + Math.random();
    14   // set a unique value on a new, blank tab
    15   let tab1 = gBrowser.addTab();
    16   whenBrowserLoaded(tab1.linkedBrowser, function() {
    17     ss.setTabValue(tab1, uniqueName, uniqueValue1);
    19     // duplicate the tab with that value
    20     let tab2 = ss.duplicateTab(window, tab1);
    21     is(ss.getTabValue(tab2, uniqueName), uniqueValue1, "tab value was duplicated");
    23     ss.setTabValue(tab2, uniqueName, uniqueValue2);
    24     isnot(ss.getTabValue(tab1, uniqueName), uniqueValue2, "tab values aren't sync'd");
    26     // overwrite the tab with the value which should remove it
    27     ss.setTabState(tab1, JSON.stringify({ entries: [] }));
    28     whenTabRestored(tab1, function() {
    29       is(ss.getTabValue(tab1, uniqueName), "", "tab value was cleared");
    31       // clean up
    32       gBrowser.removeTab(tab2);
    33       gBrowser.removeTab(tab1);
    34       finish();
    35     });
    36   });
    37 }

mercurial