Bug 1915045 Ensure decode tasks are scheduled on BufferingState::Enter() r=media...
[gecko.git] / js / xpconnect / tests / chrome / test_bug1390159.xhtml
blob7d5b917a27fc9f3578e4d6d21fe656ea22e27df2
1 <?xml version="1.0"?>
2 <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
3 <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
4 type="text/css"?>
5 <!--
6 https://bugzilla.mozilla.org/show_bug.cgi?id=1390159
7 -->
8 <window title="Mozilla Bug 1390159"
9 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
10 <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
12 <!-- test code goes here -->
13 <script type="application/javascript"><![CDATA[
14 function test() {
15 var xulRuntime = Services.appinfo;
17 // Make sure it has an inSafeMode property. This is just an arbitrary
18 // readonly property.
19 var oldValue = xulRuntime.inSafeMode;
20 is(typeof oldValue, "boolean", "Expected an inSafeMode property");
22 // Changing a readonly property doesn't throw, but shouldn't change
23 // the value.
24 xulRuntime.inSafeMode = !oldValue;
25 is(xulRuntime.inSafeMode, oldValue, "Should not have modified prop");
27 // Adding a new property should throw.
28 let ex = null;
29 try {
30 xulRuntime.foobar = 1;
31 } catch (e) {
32 ex = e;
34 is(ex.toString().includes("Cannot modify"), true, "Expected an error");
35 is(xulRuntime.foobar, undefined, "Property not defined");
37 test();
38 ]]></script>
40 <!-- test results are displayed in the html:body -->
41 <body xmlns="http://www.w3.org/1999/xhtml">
42 </body>
44 </window>