OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../../media/media-file.js"></script> | 4 <script src="../../media/media-file.js"></script> |
5 <script src="../../media/video-test.js"></script> | 5 <script src="../../media/video-test.js"></script> |
6 <script type="text/javascript"> | 6 <script type="text/javascript"> |
7 var videoElement; | 7 var videoElement; |
8 var standaloneMediaDocument; | 8 var standaloneMediaDocument; |
9 var skipOnFirstEmptyLoad = 0; | 9 var skipOnFirstEmptyLoad = 0; |
10 | 10 |
(...skipping 10 matching lines...) Expand all Loading... |
21 },false); | 21 },false); |
22 | 22 |
23 testFocus(); | 23 testFocus(); |
24 testFocusbyMouseClick(); | 24 testFocusbyMouseClick(); |
25 consoleWrite(""); | 25 consoleWrite(""); |
26 endTest(); | 26 endTest(); |
27 } | 27 } |
28 | 28 |
29 function testFocus() | 29 function testFocus() |
30 { | 30 { |
31 consoleWrite("<br>*** Should not focus video element by calling
focus() method."); | 31 consoleWrite("<br>*** Should focus video element by calling focu
s() method."); |
32 videoElement.focus(); | 32 videoElement.focus(); |
33 testExpected("standaloneMediaDocument.activeElement", videoEleme
nt, "!="); | 33 testExpected("standaloneMediaDocument.activeElement", videoEleme
nt, "=="); |
34 } | 34 } |
35 | 35 |
36 function testFocusbyMouseClick() | 36 function testFocusbyMouseClick() |
37 { | 37 { |
| 38 videoElement.blur(); |
38 // Simulate click event to try focus video element. | 39 // Simulate click event to try focus video element. |
39 consoleWrite("<br>*** Should not focus video element by mouse cl
ick."); | 40 consoleWrite("<br>*** Should not focus video element by mouse cl
ick."); |
40 var click = document.createEvent("MouseEvents"); | 41 var click = document.createEvent("MouseEvents"); |
41 click.initMouseEvent("click", true, true, window, 1, 0, 0, 0, 0,
false, false, false, false, 0, document); | 42 click.initMouseEvent("click", true, true, window, 1, 0, 0, 0, 0,
false, false, false, false, 0, document); |
42 videoElement.dispatchEvent(click); | 43 videoElement.dispatchEvent(click); |
43 testExpected("standaloneMediaDocument.activeElement", videoEleme
nt, "!="); | 44 testExpected("standaloneMediaDocument.activeElement", videoEleme
nt, "!="); |
44 } | 45 } |
45 </script> | 46 </script> |
46 </head> | 47 </head> |
47 <body> | 48 <body> |
48 <p> | 49 <p> |
49 This tests that media element in a standalone media document cannot
be focused directly using focus() method or by mouse click. | 50 This tests that media element in a standalone media document can be
focused directly using focus() method and not by mouse click. |
50 </p> | 51 </p> |
51 <iframe id="videoframe" width=380 height=330 onload="frameLoaded()"></if
rame> | 52 <iframe id="videoframe" width=380 height=330 onload="frameLoaded()"></if
rame> |
52 <script type="text/javascript"> | 53 <script type="text/javascript"> |
53 document.getElementById("videoframe").src = "../../media/" + findMed
iaFile("video", "content/test"); | 54 document.getElementById("videoframe").src = "../../media/" + findMed
iaFile("video", "content/test"); |
54 </script> | 55 </script> |
55 </body> | 56 </body> |
56 </html> | 57 </html> |
OLD | NEW |