|
1 <?xml version="1.0"?> |
|
2 |
|
3 <!-- This Source Code Form is subject to the terms of the Mozilla Public |
|
4 - License, v. 2.0. If a copy of the MPL was not distributed with this |
|
5 - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> |
|
6 |
|
7 <?xml-stylesheet href="chrome://global/skin" type="text/css"?> |
|
8 |
|
9 <window id="bug586713_window" |
|
10 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" |
|
11 width="300" |
|
12 height="300" |
|
13 onload="onLoad();" |
|
14 title="Bug 586713 Test"> |
|
15 |
|
16 <menubar id="nativemenubar"> |
|
17 <menu id="foo" label="Foo"> |
|
18 <menupopup> |
|
19 <menuitem label="FooItem0"/> |
|
20 </menupopup> |
|
21 </menu> |
|
22 </menubar> |
|
23 |
|
24 <script type="application/javascript"><![CDATA[ |
|
25 function ok(condition, message) { |
|
26 window.opener.wrappedJSObject.SimpleTest.ok(condition, message); |
|
27 } |
|
28 |
|
29 function onTestsFinished() { |
|
30 window.close(); |
|
31 window.opener.wrappedJSObject.SimpleTest.finish(); |
|
32 } |
|
33 |
|
34 var fooCallCount = 0; |
|
35 function foo() { |
|
36 fooCallCount++; |
|
37 let instruction = document.createProcessingInstruction("xml-stylesheet", 'href="chrome://foo.css" type="text/css"'); |
|
38 document.insertBefore(instruction, document.documentElement); |
|
39 if (fooCallCount == 2) { |
|
40 ok(true, "If we got here we didn't crash, excellent."); |
|
41 onTestsFinished(); |
|
42 } |
|
43 } |
|
44 |
|
45 function onLoad() { |
|
46 foo(); |
|
47 setTimeout(function() foo(), 0); |
|
48 } |
|
49 ]]></script> |
|
50 </window> |