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

Side by Side Diff: third_party/WebKit/LayoutTests/media/controls-repaint-for-network-change.html

Issue 1417683004: Media controls refer to less magic state. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased, fixed assert. Created 5 years, 1 month 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
(Empty)
1 <!DOCTYPE html>
2 <style>
3 /* restrict to just the play button, so the slider doesn't mismatch */
4 audio {
5 width: 40px;
6 height: 40px;
7 }
8 </style>
9 <script src="../resources/run-after-layout-and-paint.js"></script>
10 <script src=media-file.js></script>
11 <script>
12
13 testRunner.waitUntilDone();
14
15 function test() {
16
17 var audios = document.querySelectorAll("audio");
18 var src = findMediaFile("audio", "content/empty");
19
20 runAfterLayoutAndPaint(function() {
21 for(var i=0; i<3 ;i++)
philipj_slow 2015/10/30 10:55:37 Needs more space ("for (var i = 0; i < 3; i++)") a
liberato (no reviews please) 2015/10/30 15:09:07 with two elements, i just unrolled.
22 window.internals.setMediaElementNetworkState(audios[i], 0);
23
24 // These will cause the play buttons to become enabled, and should
25 // also cause a repaint.
26 for(var i=1; i<3 ;i++)
27 window.internals.setMediaElementNetworkState(audios[i], 2);
28
29 // This will cause the play button to go back to its original state.
30 window.internals.setMediaElementNetworkState(audios[2], 0);
philipj_slow 2015/10/30 10:55:37 Given that audio 0 and 1 end up in the same state,
liberato (no reviews please) 2015/10/30 15:09:07 Done.
31
32 testRunner.notifyDone();
33 });
34
35 }
36 </script>
37
38 <body onload="test()">
philipj_slow 2015/10/30 10:55:37 If you like you can omit the <body> and just put t
liberato (no reviews please) 2015/10/30 15:09:07 Done.
39 <audio id="audio1" controls></audio>
philipj_slow 2015/10/30 10:55:37 The IDs are unused.
liberato (no reviews please) 2015/10/30 15:09:07 Done.
40 <audio id="audio2" controls></audio>
41 <audio id="audio3" controls></audio>
42 <p>Test that network state transitions paint audio controls properly.</p>
43 </body>
44
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698