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

Side by Side Diff: third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-set-mediakeys-at-same-time.html

Issue 1463763002: Add event name to bare removeEventListener(listener) calls (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <title>Set MediaKeys multiple times in parallel</title> 4 <title>Set MediaKeys multiple times in parallel</title>
5 <script src="encrypted-media-utils.js"></script> 5 <script src="encrypted-media-utils.js"></script>
6 <script src="../../resources/testharness.js"></script> 6 <script src="../../resources/testharness.js"></script>
7 <script src="../../resources/testharnessreport.js"></script> 7 <script src="../../resources/testharnessreport.js"></script>
8 </head> 8 </head>
9 <body> 9 <body>
10 <video id="video"></video> 10 <video id="video"></video>
11 <div id="log"></div> 11 <div id="log"></div>
12 <script> 12 <script>
13 // Wait for an 'encrypted' event as a promise. 13 // Wait for an 'encrypted' event as a promise.
14 function wait_for_encrypted_event(video) 14 function wait_for_encrypted_event(video)
15 { 15 {
16 return new Promise(function(resolve) { 16 return new Promise(function(resolve) {
17 video.addEventListener('encrypted', function listener(e) { 17 video.addEventListener('encrypted', function listener(e) {
18 video.removeEventListener(listener); 18 video.removeEventListener('encrypted', listener);
19 resolve(); 19 resolve();
20 }); 20 });
21 }); 21 });
22 }; 22 };
23 23
24 // Return a promise that calls setMediaKeys() and returns 1 if 24 // Return a promise that calls setMediaKeys() and returns 1 if
25 // resolved, 0 if rejected. If |must_succeed| is true, then 25 // resolved, 0 if rejected. If |must_succeed| is true, then
26 // setMediaKeys() should not fail. 26 // setMediaKeys() should not fail.
27 function setMediaKeys_as_count(video, mediaKeys, must_succeed) 27 function setMediaKeys_as_count(video, mediaKeys, must_succeed)
28 { 28 {
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 return count_promise_results([p1, p2, p3, p4, p5]); 95 return count_promise_results([p1, p2, p3, p4, p5]);
96 }).then(function(count) { 96 }).then(function(count) {
97 // At least one of the setMediaKeys() calls should have 97 // At least one of the setMediaKeys() calls should have
98 // succeeded. 98 // succeeded.
99 assert_greater_than(count, 0); 99 assert_greater_than(count, 0);
100 }); 100 });
101 }, 'Set MediaKeys multiple times in parallel.'); 101 }, 'Set MediaKeys multiple times in parallel.');
102 </script> 102 </script>
103 </body> 103 </body>
104 </html> 104 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698