summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/images/image-document-write-assert.html
blob: 9b27e19d8dc0ad95e94b4852c2fe1f520c2aa5f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<!DOCTYPE html>
<html>
<script>

if (window.testRunner) {
    testRunner.dumpAsText();
    testRunner.setCanOpenWindows();
    testRunner.waitUntilDone();
}

function log(message)
{
    var console = document.getElementById("console");
    console.appendChild(document.createTextNode(message + "\n"));
}

function loadPage()
{
    var newwindow = window.open("resources/dice.png");
    newwindow.onload = function() {
	    if (window.eventSender) {
		newwindow.document.write("This doesn't crash");
 		log ("Test Success");
		testRunner.notifyDone();
	   } else 
		newwindow.document.write("This doesn't crash");
    };
}
</script>
<body onload="loadPage()">
<p>This tests that writing on an "image page" doesn't asserts the tab. This test requires testRunner to run.  To test manually, open <a href="resources/dice.png">this image</a> in a browser window, and write into the page using document.write. It must not crash.</p>
<pre id="console"></pre>
</body>
</html>