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

Unified Diff: third_party/WebKit/LayoutTests/media/audio-constructor-src.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
Index: third_party/WebKit/LayoutTests/media/audio-constructor-src.html
diff --git a/third_party/WebKit/LayoutTests/media/audio-constructor-src.html b/third_party/WebKit/LayoutTests/media/audio-constructor-src.html
index 728dfd911ee250b8d9c0c6dfed6b2b76551ce91d..0cebeb84578c35bc2f07ae733fa06c1b72f54ddc 100644
--- a/third_party/WebKit/LayoutTests/media/audio-constructor-src.html
+++ b/third_party/WebKit/LayoutTests/media/audio-constructor-src.html
@@ -1,17 +1,18 @@
-<body>
-<p>Test that Audio("url") constructor loads the specified resource.</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("url") constructor loads the specified resource.</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 audioFile = findMediaFile("audio", "content/test");
var audio = new Audio(audioFile);
- mediaElement = audio;
- testExpected("audio instanceof HTMLAudioElement", true);
+ audio.onloadstart = t.step_func(function () {
+ var url = audio.currentSrc;
+ assert_equals(url.substr(url.lastIndexOf("/media/")+7), audioFile);
+ });
- waitForEvent("loadstart", function () { testExpected("relativeURL(audio.currentSrc)", audioFile); });
-
- waitForEventAndEnd("canplaythrough");
-</script>
+ audio.oncanplaythrough = t.step_func_done();
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698