1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/content/canvas/test/test_drawWindow.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,55 @@ 1.4 +<!DOCTYPE HTML> 1.5 +<html> 1.6 +<head> 1.7 + <meta charset="utf-8"> 1.8 + <title>Test for canvas drawWindow</title> 1.9 + <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> 1.10 + <script type="application/javascript" src="/tests/SimpleTest/WindowSnapshot.js"></script> 1.11 + <script type="application/javascript" src="file_drawWindow_common.js"></script> 1.12 + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 1.13 + <script type="application/javascript"> 1.14 + 1.15 + SimpleTest.waitForExplicitFinish(); 1.16 + window.addEventListener("load", openSourceWindow, false); 1.17 + 1.18 + var sourceWindow; 1.19 + 1.20 + function openSourceWindow(event) { 1.21 + if (event.target != document) { 1.22 + return; 1.23 + } 1.24 + 1.25 + sourceWindow = window.open("file_drawWindow_source.html", "", 1.26 + "width=200,height=100"); 1.27 + sourceWindow.addEventListener("load", runTests, false); 1.28 + } 1.29 + 1.30 + function runTests(event) { 1.31 + if (event.target != sourceWindow.document) { 1.32 + return; 1.33 + } 1.34 + 1.35 + // Run the tests with the source document in an <iframe> within this 1.36 + // page, which we expect to have transparency. 1.37 + runDrawWindowTests(document.getElementById("source").contentWindow, 1.38 + 0, true); 1.39 + 1.40 + // Run the tests on the same source document, but in a window opened 1.41 + // by window.open. We do not expect this to have transparency... 1.42 + // except on B2G. (This is *probably* a bug in B2G.) 1.43 + var isB2G = /Mobile|Tablet/.test(navigator.userAgent) && 1.44 + !navigator.userAgent.contains("Android"); 1.45 + runDrawWindowTests(sourceWindow, 0, isB2G); 1.46 + 1.47 + sourceWindow.close(); 1.48 + 1.49 + SimpleTest.finish(); 1.50 + } 1.51 + 1.52 + </script> 1.53 +</head> 1.54 +<body> 1.55 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=">Mozilla Bug </a> 1.56 +<iframe id="source" src="file_drawWindow_source.html" width="200" height="100"></iframe> 1.57 +</body> 1.58 +</html>