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

Unified Diff: third_party/WebKit/LayoutTests/media/audio-play-event.html

Issue 2009993003: Convert audio-data*, audio-garbage* and audio-play* tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed eventcount Created 4 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
Index: third_party/WebKit/LayoutTests/media/audio-play-event.html
diff --git a/third_party/WebKit/LayoutTests/media/audio-play-event.html b/third_party/WebKit/LayoutTests/media/audio-play-event.html
index d20c9086c498ab8d35d89665820c949664477e05..906651cfb9e5e0335a4a617bf03cc1e55984cbc9 100644
--- a/third_party/WebKit/LayoutTests/media/audio-play-event.html
+++ b/third_party/WebKit/LayoutTests/media/audio-play-event.html
@@ -1,28 +1,17 @@
-<html>
- <head>
- <title>'play' event</title>
- <script src=media-file.js></script>
- <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
- (Please avoid writing new tests using video-test.js) -->
- <script src=video-test.js></script>
-
- <script>
- function start()
- {
- mediaElement = new Audio();
- waitForEvent('error');
- waitForEvent('loadedmetadata');
- waitForEvent('canplay');
- waitForEvent('play');
- waitForEvent('playing', function() { endTest(); });
- run("mediaElement.src = findMediaFile('audio', 'content/test')");
- run("mediaElement.volume = 1");
- run("mediaElement.play()");
- }
- </script>
- </head>
-
- <body onload="start()">
- <p>Test that a 'play' event listener is triggered when fired by a new audio element.</p>
- </body>
-</html>
+<!DOCTYPE HTML>
+<title>Test that a 'play' event is fired by a new audio element on playing.</title>
+<script src="media-file.js"></script>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script>
+async_test(function(t) {
+ var audio = new Audio();
+ audio.onplay = t.step_func(function() {});
+ audio.onloadedmetadata = t.step_func(function() {});
+ audio.oncanplay = t.step_func(function() {});
+ audio.onplaying = t.step_func_done();
+ audio.onerror = t.unreached_func("Should not fire 'error' event");
+ audio.src = findMediaFile("audio", "content/test");
+ audio.play();
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698