Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / events / media-focus-in-standalone-media-document.html
blobad515fdda6789d150dbe7d3f36eafda6b462be7b
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../media/media-file.js"></script>
5 <script src="../../media/video-test.js"></script>
6 <script type="text/javascript">
7 var videoElement;
8 var standaloneMediaDocument;
9 var skipOnFirstEmptyLoad = 0;
11 function frameLoaded()
13 if (++skipOnFirstEmptyLoad == 1)
14 return;
16 standaloneMediaDocument = document.getElementById("videoframe").contentDocument;
17 videoElement = standaloneMediaDocument.querySelector("video");
19 videoElement.addEventListener('click',function(){
20 consoleWrite("*** Video element clicked.");
21 },false);
23 testFocus();
24 testFocusbyMouseClick();
25 consoleWrite("");
26 endTest();
29 function testFocus()
31 consoleWrite("<br>*** Should not focus video element by calling focus() method.");
32 videoElement.focus();
33 testExpected("standaloneMediaDocument.activeElement", videoElement, "!=");
36 function testFocusbyMouseClick()
38 // Simulate click event to try focus video element.
39 consoleWrite("<br>*** Should not focus video element by mouse click.");
40 var click = document.createEvent("MouseEvents");
41 click.initMouseEvent("click", true, true, window, 1, 0, 0, 0, 0, false, false, false, false, 0, document);
42 videoElement.dispatchEvent(click);
43 testExpected("standaloneMediaDocument.activeElement", videoElement, "!=");
45 </script>
46 </head>
47 <body>
48 <p>
49 This tests that media element in a standalone media document cannot be focused directly using focus() method or by mouse click.
50 </p>
51 <iframe id="videoframe" width=380 height=330 onload="frameLoaded()"></iframe>
52 <script type="text/javascript">
53 document.getElementById("videoframe").src = "../../media/" + findMediaFile("video", "content/test");
54 </script>
55 </body>
56 </html>