2 <?xml-stylesheet href=
"chrome://global/skin" type=
"text/css"?>
3 <?xml-stylesheet href=
"chrome://mochikit/content/tests/SimpleTest/test.css"
6 https://bugzilla.mozilla.org/show_bug.cgi?id=1390159
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[
15 var xulRuntime = Services.appinfo;
17 // Make sure it has an inSafeMode property. This is just an arbitrary
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
24 xulRuntime.inSafeMode = !oldValue;
25 is(xulRuntime.inSafeMode, oldValue,
"Should not have modified prop");
27 // Adding a new property should throw.
30 xulRuntime.foobar =
1;
34 is(ex.toString().includes(
"Cannot modify"), true,
"Expected an error");
35 is(xulRuntime.foobar, undefined,
"Property not defined");
40 <!-- test results are displayed in the html:body -->
41 <body xmlns=
"http://www.w3.org/1999/xhtml">