Index: third_party/WebKit/LayoutTests/media/controls-repaint-for-network-change.html |
diff --git a/third_party/WebKit/LayoutTests/media/controls-repaint-for-network-change.html b/third_party/WebKit/LayoutTests/media/controls-repaint-for-network-change.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..559aaefa50eec11bd331ba5cd7bc731c9dbb16a2 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/media/controls-repaint-for-network-change.html |
@@ -0,0 +1,44 @@ |
+<!DOCTYPE html> |
+<style> |
+ /* restrict to just the play button, so the slider doesn't mismatch */ |
+ audio { |
+ width: 40px; |
+ height: 40px; |
+ } |
+</style> |
+<script src="../resources/run-after-layout-and-paint.js"></script> |
+<script src=media-file.js></script> |
+<script> |
+ |
+testRunner.waitUntilDone(); |
+ |
+function test() { |
+ |
+ var audios = document.querySelectorAll("audio"); |
+ var src = findMediaFile("audio", "content/empty"); |
+ |
+ runAfterLayoutAndPaint(function() { |
+ 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.
|
+ window.internals.setMediaElementNetworkState(audios[i], 0); |
+ |
+ // These will cause the play buttons to become enabled, and should |
+ // also cause a repaint. |
+ for(var i=1; i<3 ;i++) |
+ window.internals.setMediaElementNetworkState(audios[i], 2); |
+ |
+ // This will cause the play button to go back to its original state. |
+ 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.
|
+ |
+ testRunner.notifyDone(); |
+ }); |
+ |
+} |
+</script> |
+ |
+<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.
|
+ <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.
|
+ <audio id="audio2" controls></audio> |
+ <audio id="audio3" controls></audio> |
+ <p>Test that network state transitions paint audio controls properly.</p> |
+</body> |
+ |