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

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: 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..e17ea8fef97805eb61e96f32c60cd8cc1d12dc80 100644
--- a/third_party/WebKit/LayoutTests/media/audio-play-event.html
+++ b/third_party/WebKit/LayoutTests/media/audio-play-event.html
@@ -1,28 +1,13 @@
-<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_done();
Srirama 2016/05/26 15:09:50 Should we test playing event as well? Based on the
fs 2016/05/26 15:35:00 Can't say that I fully understand the reasoning be
Srirama 2016/05/26 17:27:51 Done.
+ audio.src = findMediaFile('audio', 'content/test');
+ audio.play();
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698