1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/widget/tests/bug586713_window.xul Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,50 @@ 1.4 +<?xml version="1.0"?> 1.5 + 1.6 +<!-- This Source Code Form is subject to the terms of the Mozilla Public 1.7 + - License, v. 2.0. If a copy of the MPL was not distributed with this 1.8 + - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> 1.9 + 1.10 +<?xml-stylesheet href="chrome://global/skin" type="text/css"?> 1.11 + 1.12 +<window id="bug586713_window" 1.13 + xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" 1.14 + width="300" 1.15 + height="300" 1.16 + onload="onLoad();" 1.17 + title="Bug 586713 Test"> 1.18 + 1.19 + <menubar id="nativemenubar"> 1.20 + <menu id="foo" label="Foo"> 1.21 + <menupopup> 1.22 + <menuitem label="FooItem0"/> 1.23 + </menupopup> 1.24 + </menu> 1.25 + </menubar> 1.26 + 1.27 + <script type="application/javascript"><![CDATA[ 1.28 + function ok(condition, message) { 1.29 + window.opener.wrappedJSObject.SimpleTest.ok(condition, message); 1.30 + } 1.31 + 1.32 + function onTestsFinished() { 1.33 + window.close(); 1.34 + window.opener.wrappedJSObject.SimpleTest.finish(); 1.35 + } 1.36 + 1.37 + var fooCallCount = 0; 1.38 + function foo() { 1.39 + fooCallCount++; 1.40 + let instruction = document.createProcessingInstruction("xml-stylesheet", 'href="chrome://foo.css" type="text/css"'); 1.41 + document.insertBefore(instruction, document.documentElement); 1.42 + if (fooCallCount == 2) { 1.43 + ok(true, "If we got here we didn't crash, excellent."); 1.44 + onTestsFinished(); 1.45 + } 1.46 + } 1.47 + 1.48 + function onLoad() { 1.49 + foo(); 1.50 + setTimeout(function() foo(), 0); 1.51 + } 1.52 + ]]></script> 1.53 +</window>