Bug 1915045 Ensure decode tasks are scheduled on BufferingState::Enter() r=media...
[gecko.git] / js / xpconnect / tests / chrome / test_matches.xhtml
blob96472bc8ac2c124aea10ed92ae31d8d720c3cf0d
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=533596
7 -->
8 <window title="Mozilla Bug 533596"
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 results are displayed in the html:body -->
13 <body xmlns="http://www.w3.org/1999/xhtml">
15 <iframe src="http://example.org/tests/js/xpconnect/tests/mochitest/file_matches.html"
16 onload="runTest(this)">
17 </iframe>
18 </body>
20 <!-- test code goes here -->
21 <script type="application/javascript"><![CDATA[
22 SimpleTest.waitForExplicitFinish();
23 function runTest(ifr)
25 var doc = ifr.contentDocument;
26 var docElem = doc.documentElement;
28 var res = doc.createElement('div').matches('div');
29 is(res, true, "matches call through xray, regular case");
31 res = docElem.matches.call(
32 doc.createElement('div'), 'div');
33 is(res, true, "matches call through xray, with .call");
35 var sb = new Cu.Sandbox(ifr.contentWindow);
36 sb.doc = doc;
37 var str = "doc.documentElement.matches.call(doc.createElement( 'div' ),'div')";
38 res = Cu.evalInSandbox(str, sb);
39 is(res, true, "matches call through xray (same origin), with .call");
41 docElem.matches = function(){return false};
42 res = docElem.matches.call(doc.createElement( 'div' ),'div');
43 is(res, false, "shadowing matches with an expando on the xray wrapper");
45 SimpleTest.finish();
48 ]]></script>
49 </window>