Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
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 | /** Test for Bug 524745 **/ |
michael@0 | 7 | |
michael@0 | 8 | let uniqKey = "bug524745"; |
michael@0 | 9 | let uniqVal = Date.now(); |
michael@0 | 10 | |
michael@0 | 11 | waitForExplicitFinish(); |
michael@0 | 12 | |
michael@0 | 13 | whenNewWindowLoaded({ private: false }, function (window_B) { |
michael@0 | 14 | waitForFocus(function() { |
michael@0 | 15 | // Add identifying information to window_B |
michael@0 | 16 | ss.setWindowValue(window_B, uniqKey, uniqVal); |
michael@0 | 17 | let state = JSON.parse(ss.getBrowserState()); |
michael@0 | 18 | let selectedWindow = state.windows[state.selectedWindow - 1]; |
michael@0 | 19 | is(selectedWindow.extData && selectedWindow.extData[uniqKey], uniqVal, |
michael@0 | 20 | "selectedWindow is window_B"); |
michael@0 | 21 | |
michael@0 | 22 | // Now minimize window_B. The selected window shouldn't have the secret data |
michael@0 | 23 | window_B.minimize(); |
michael@0 | 24 | waitForFocus(function() { |
michael@0 | 25 | state = JSON.parse(ss.getBrowserState()); |
michael@0 | 26 | selectedWindow = state.windows[state.selectedWindow - 1]; |
michael@0 | 27 | ok(!selectedWindow.extData || !selectedWindow.extData[uniqKey], |
michael@0 | 28 | "selectedWindow is not window_B after minimizing it"); |
michael@0 | 29 | |
michael@0 | 30 | // Now minimize the last open window (assumes no other tests left windows open) |
michael@0 | 31 | window.minimize(); |
michael@0 | 32 | state = JSON.parse(ss.getBrowserState()); |
michael@0 | 33 | is(state.selectedWindow, 0, |
michael@0 | 34 | "selectedWindow should be 0 when all windows are minimized"); |
michael@0 | 35 | |
michael@0 | 36 | // Cleanup |
michael@0 | 37 | window.restore(); |
michael@0 | 38 | window_B.close(); |
michael@0 | 39 | finish(); |
michael@0 | 40 | }); |
michael@0 | 41 | }, window_B); |
michael@0 | 42 | }); |
michael@0 | 43 | } |