browser/components/sessionstore/test/browser_694378.js

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:2c9581335607
1 /* Any copyright is dedicated to the Public Domain.
2 http://creativecommons.org/publicdomain/zero/1.0/ */
3
4 // Test Summary:
5 // 1. call ss.setWindowState with a broken state
6 // 1a. ensure that it doesn't throw.
7
8 function test() {
9 waitForExplicitFinish();
10
11 let brokenState = {
12 windows: [
13 { tabs: [{ entries: [{ url: "about:mozilla" }] }] }
14 ],
15 selectedWindow: 2
16 };
17 let brokenStateString = JSON.stringify(brokenState);
18
19 let gotError = false;
20 try {
21 ss.setWindowState(window, brokenStateString, true);
22 }
23 catch (ex) {
24 gotError = true;
25 info(ex);
26 }
27
28 ok(!gotError, "ss.setWindowState did not throw an error");
29
30 // Make sure that we reset the state. Use a full state just in case things get crazy.
31 let blankState = { windows: [{ tabs: [{ entries: [{ url: "about:blank" }] }]}]};
32 waitForBrowserState(blankState, finish);
33 }

mercurial