1 <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
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>
16 <browser id="content" type="content-primary" name="content" src="about:blank" flex="1"
17 disablehistory="true" context="viewSourceContextMenu"/>
19 <script type="application/javascript">
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
26 SimpleTest.waitForExplicitFinish();
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>");
40 ok(doc.getElementById("heading").textContent, headingText,
41 "content document has content");