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

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

Issue 1997263002: Convert audio-constructor* 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/audio-constructor-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/media/audio-constructor.html
diff --git a/third_party/WebKit/LayoutTests/media/audio-constructor.html b/third_party/WebKit/LayoutTests/media/audio-constructor.html
index ff26bc572edde2479b2e01e3f830dea484acc72a..dadaf589fb1acdeb0879845420f4e4364579ff85 100644
--- a/third_party/WebKit/LayoutTests/media/audio-constructor.html
+++ b/third_party/WebKit/LayoutTests/media/audio-constructor.html
@@ -1,22 +1,21 @@
-<body>
-<p>Test that Audio() object loads the resource after src attribute is set and load() is called.</p>
-
-<script src=media-file.js></script>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
- (Please avoid writing new tests using video-test.js) -->
-<script src=video-test.js></script>
-
+<!DOCTYPE html>
+<title>Test that Audio() object loads the resource after src attribute is set and load() is called.</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();
- mediaElement = audio;
-
- testExpected("audio instanceof HTMLAudioElement", true);
- var mediaFile = findMediaFile("audio", "content/test");
- waitForEvent("loadstart", function () { testExpected("relativeURL(audio.currentSrc)", mediaFile); });
+ var audioFile = findMediaFile("audio", "content/test");
+ audio.src = audioFile;
+ audio.onloadstart = t.step_func(function () {
+ var url = audio.currentSrc;
+ assert_equals(url.substr(url.lastIndexOf("/media/")+7), audioFile);
+ });
- waitForEventAndEnd("canplaythrough");
+ audio.oncanplaythrough = t.step_func_done();
- audio.src = mediaFile;
- run("audio.load()");
-</script>
+ audio.load();
+});
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/audio-constructor-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698