Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/security/mixedContent/resources/frame-with-insecure-audio-video.html

Issue 1703333002: Fix a test race - synchronize test completion to media's loadstart event. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/FlagExpectations/site-per-process ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <body> 1 <body>
2 <audio></audio> 2 <audio></audio>
3 <video></video> 3 <video></video>
4 <script> 4 <script>
5 window.addEventListener('load', function () { 5 window.addEventListener('load', function () {
6 var windowOpener = window.opener;
7 var isAudioLoaded = false;
8 var isVideoLoaded = false;
9 function checkTestCompletion() {
10 if (isAudioLoaded && isVideoLoaded && windowOpener) {
11 windowOpener.postMessage('done', '*');
12 }
13 }
14
6 // Assigning via JavaScript after 'load' rather than direclty in the 15 // Assigning via JavaScript after 'load' rather than direclty in the
7 // markup in order to avoid the console's flaky "what line am I on?" 16 // markup in order to avoid the console's flaky "what line am I on?"
8 // autodetection. 17 // autodetection.
9 document.querySelector('audio').src = "http://127.0.0.1:8080/resources/t est.mp4"; 18 var audioElement = document.querySelector('audio');
10 document.querySelector('video').src = "http://127.0.0.1:8080/resources/t est.mp4"; 19 audioElement.src = "http://127.0.0.1:8080/resources/test.mp4";
11 if (window.opener) 20 audioElement.addEventListener("loadstart", function(event) {
12 window.opener.postMessage('done', '*'); 21 isAudioLoaded = true;
22 checkTestCompletion();
23 });
24
25 var videoElement = document.querySelector('video');
26 videoElement.src = "http://127.0.0.1:8080/resources/test.mp4";
27 videoElement.addEventListener("loadstart", function(event) {
28 isVideoLoaded = true;
29 checkTestCompletion();
30 });
13 }); 31 });
14 </script> 32 </script>
15 </body> 33 </body>
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/FlagExpectations/site-per-process ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698