upload tizen1.0 source
[framework/web/webkit-efl.git] / LayoutTests / media / crash-closing-page-with-media-as-plugin-fallback.html
1 <script>
2 var childWindow;
3 </script>
4 This test makes sure that closing a window with a video element that has a poster image doesn't crash (radar 10576732 and https://bugs.webkit.org/show_bug.cgi?id=74533)<br>
5 If it doesn't crash, it passes.<br>
6 <button id="button" onclick="childWindow = window.open('resources/video-with-poster-as-object-fallback.html')">
7     Click here to open test window
8 </button><br>
9 <div id="result"></div><br>
10
11 <script>
12 if (window.layoutTestController) {
13     layoutTestController.dumpAsText();
14     layoutTestController.waitUntilDone();
15     layoutTestController.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
16     layoutTestController.overridePreference("WebKitPageCacheSupportsPluginsPreferenceKey", 1);
17     layoutTestController.setCanOpenWindows(true);
18     layoutTestController.setCloseRemainingWindowsWhenComplete(true);
19     var button = document.getElementById("button");
20     eventSender.mouseMoveTo(button.offsetParent.offsetLeft + button.offsetLeft + button.offsetWidth / 2, button.offsetParent.offsetTop +  button.offsetTop + button.offsetHeight / 2);
21     eventSender.mouseDown();
22     eventSender.mouseUp();
23 }
24
25 function childLoaded()
26 {
27     childWindow.close();
28     setTimeout("checkClosed()", 0);
29 }
30
31 function checkClosed()
32 {
33     if (childWindow.closed) {
34         document.getElementById("result").innerText = "Closed the window without crashing!";
35         if (window.layoutTestController)
36             setTimeout("layoutTestController.notifyDone();", 0);
37     }
38     setTimeout("checkClosed()", 0);
39 }
40
41 </script>