michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: // Test Summary: michael@0: // 1. call ss.setWindowState with a broken state michael@0: // 1a. ensure that it doesn't throw. michael@0: michael@0: function test() { michael@0: waitForExplicitFinish(); michael@0: michael@0: let brokenState = { michael@0: windows: [ michael@0: { tabs: [{ entries: [{ url: "about:mozilla" }] }] } michael@0: ], michael@0: selectedWindow: 2 michael@0: }; michael@0: let brokenStateString = JSON.stringify(brokenState); michael@0: michael@0: let gotError = false; michael@0: try { michael@0: ss.setWindowState(window, brokenStateString, true); michael@0: } michael@0: catch (ex) { michael@0: gotError = true; michael@0: info(ex); michael@0: } michael@0: michael@0: ok(!gotError, "ss.setWindowState did not throw an error"); michael@0: michael@0: // Make sure that we reset the state. Use a full state just in case things get crazy. michael@0: let blankState = { windows: [{ tabs: [{ entries: [{ url: "about:blank" }] }]}]}; michael@0: waitForBrowserState(blankState, finish); michael@0: }