1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/layout/base/tests/test_bug583889.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,55 @@ 1.4 +<!DOCTYPE HTML> 1.5 +<html> 1.6 +<!-- 1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=583889 1.8 +--> 1.9 +<head> 1.10 + <title>Test for Bug 583889</title> 1.11 + <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> 1.12 + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 1.13 +</head> 1.14 +<body> 1.15 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=583889">Mozilla Bug 583889</a> 1.16 +<iframe id="inner" style="width: 10px; height: 10px;"></iframe> 1.17 +<pre id="test"> 1.18 +<script type="application/javascript;version=1.8"> 1.19 + 1.20 +/** Test for Bug 583889 **/ 1.21 +SimpleTest.waitForExplicitFinish(); 1.22 + 1.23 +function grabEventAndGo(event) { 1.24 + gen.send(event); 1.25 +} 1.26 + 1.27 +function runTest() { 1.28 + window.onload = grabEventAndGo; 1.29 + // Wait for onLoad event. 1.30 + yield; 1.31 + 1.32 + var inner = $("inner"); 1.33 + inner.src = "bug583889_inner1.html"; 1.34 + window.onmessage = grabEventAndGo; 1.35 + // Wait for message from 'inner' iframe. 1.36 + event = yield; 1.37 + 1.38 + while (event.data != "done") { 1.39 + data = JSON.parse(event.data); 1.40 + is(data.top, 300, "should remain at same top"); 1.41 + is(data.left, 300, "should remain at same left"); 1.42 + 1.43 + // Wait for message from 'inner' iframe. 1.44 + event = yield; 1.45 + } 1.46 + 1.47 + // finish(), yet let the test actually end first, to be safe. 1.48 + SimpleTest.executeSoon(SimpleTest.finish); 1.49 + // "End" generator. 1.50 + yield; 1.51 +} 1.52 + 1.53 +var gen = runTest(); 1.54 +gen.next(); 1.55 +</script> 1.56 +</pre> 1.57 +</body> 1.58 +</html>