Backed out changeset 2450366cf7ca (bug 1891629) for causing win msix mochitest failures
[gecko.git] / widget / tests / bug586713_window.xhtml
blobc180c00235c5747f9efe6f5cfc38943dabbb8ca9
1 <?xml version="1.0"?>
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/. -->
7 <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
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">
16 <menubar id="nativemenubar">
17 <menu id="foo" label="Foo">
18 <menupopup>
19 <menuitem label="FooItem0"/>
20 </menupopup>
21 </menu>
22 </menubar>
24 <script type="application/javascript"><![CDATA[
25 function ok(condition, message) {
26 window.arguments[0].SimpleTest.ok(condition, message);
29 function onTestsFinished() {
30 window.close();
31 window.arguments[0].SimpleTest.finish();
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();
45 function onLoad() {
46 foo();
47 setTimeout(() => foo(), 0);
49 ]]></script>
50 </window>