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

Unified Diff: LayoutTests/media/audio-controls-do-not-fade-out.html

Issue 302603003: Cleanup tests related to controls hiding/fading in/out (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Tweaks. Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/media/audio-controls-do-not-fade-out-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/media/audio-controls-do-not-fade-out.html
diff --git a/LayoutTests/media/audio-controls-do-not-fade-out.html b/LayoutTests/media/audio-controls-do-not-fade-out.html
index ff5bd6e065bf2a292b773458aec852410d553cc9..ca23727921ccdff4582d49ed688b447f8df3a855 100644
--- a/LayoutTests/media/audio-controls-do-not-fade-out.html
+++ b/LayoutTests/media/audio-controls-do-not-fade-out.html
@@ -1,27 +1,29 @@
+<script src="video-test.js"></script>
<script src="media-controls.js"></script>
<body>
<p>
This tests that audio controls do not fade out when the audio is playing.
</p>
-<p id="result">
- FAIL: Test did not run.
-</p>
-<audio id="audio" controls autoplay src="content/test.oga"></audio><br>
+<audio id="audio" controls autoplay src="content/test.oga"></audio>
<script>
+ var controls;
+
if (window.testRunner) {
testRunner.waitUntilDone();
testRunner.dumpAsText();
}
- document.getElementById("audio").addEventListener("timeupdate", function(e)
+ var audio = document.getElementById("audio");
+ audio.addEventListener("playing", function()
{
- if (e.target.currentTime < 4) {
- return;
- }
- var controls = mediaControlsElement(internals.shadowRoot(e.target).firstChild, "-webkit-media-controls-panel");
- var opacity = getComputedStyle(controls).opacity;
- document.getElementById("result").innerText = opacity < 1 ? "FAIL" : "PASS";
- testRunner.notifyDone();
+ runAfterControlsHidden(function()
+ {
+ controls = mediaControlsButton(audio, "panel");
+ testExpected("getComputedStyle(controls).opacity", 1);
+
+ consoleWrite("");
+ endTest();
+ }, audio);
});
</script>
</body>
« no previous file with comments | « no previous file | LayoutTests/media/audio-controls-do-not-fade-out-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698