Bug 452317 - FeedConverter.js: QueryInterface should throw NS_ERROR_NO_INTERFACE...
[wine-gecko.git] / toolkit / components / viewsource / test / test_428653.xul
blobc79a14b098195ebce4608c11f94ac406a42d199c
1 <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> 
2 <?xml-stylesheet
3   href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
5 <window title="View Source Test (bug 428653)"
6         xmlns:html="http://www.w3.org/1999/xhtml"
7         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
9   <script type="application/javascript"
10    src="chrome://mochikit/content/MochiKit/packed.js"></script>
11   <script type="application/javascript"
12    src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
13    
14   <html:body/>
16   <browser id="content" type="content-primary" name="content" src="about:blank" flex="1"
17            disablehistory="true" context="viewSourceContextMenu"/>
19   <script type="application/javascript">
20   <![CDATA[
21   /*
22   Test that we can call the content browser's document.open() via
23   wrappedJSObject (SafeJSObjectWrapper).
24   https://bugzilla.mozilla.org/show_bug.cgi?id=428653
25   */
26   SimpleTest.waitForExplicitFinish();
27   
28   addLoadEvent(function testDocumentOpen() {
29     var browser = document.getElementById("content");
30     ok(browser, "got browser");
31     var doc = browser.contentDocument.wrappedJSObject;
32     ok(doc, "got content document");
34     doc.open("text/html", "replace");
36     var headingText = "This is a heading";
37     doc.write("<h1 id='heading'>" + headingText + "</h1>");
38     doc.close();
40     ok(doc.getElementById("heading").textContent, headingText,
41        "content document has content");
42     
43     SimpleTest.finish();
44   });
45   ]]>
46   </script>
47 </window>