browser_694378.js (967B)
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 add_task(async function test_brokenWindowState() { 9 let brokenState = { 10 windows: [ 11 { 12 tabs: [ 13 { entries: [{ url: "about:mozilla", triggeringPrincipal_base64 }] }, 14 ], 15 }, 16 ], 17 selectedWindow: 2, 18 }; 19 20 let gotError = false; 21 try { 22 await setWindowState(window, brokenState, true); 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 = { 32 windows: [ 33 { 34 tabs: [ 35 { entries: [{ url: "about:blank", triggeringPrincipal_base64 }] }, 36 ], 37 }, 38 ], 39 }; 40 await promiseBrowserState(blankState); 41 });