Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/media/video-source-error-no-candidate.html |
| diff --git a/third_party/WebKit/LayoutTests/media/video-source-error-no-candidate.html b/third_party/WebKit/LayoutTests/media/video-source-error-no-candidate.html |
| index 487c647aa8d34073df658bc244df40f2fe3e784c..fd213438e0a359fc5e3332563e2e5584c7b77511 100644 |
| --- a/third_party/WebKit/LayoutTests/media/video-source-error-no-candidate.html |
| +++ b/third_party/WebKit/LayoutTests/media/video-source-error-no-candidate.html |
| @@ -1,62 +1,22 @@ |
| -<html lang="en"> |
| - <head> |
| - <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
| - <title><video> and <source> error test</title> |
| - <!-- 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> |
| - |
| - var sources = []; |
| - var errorCount = 0; |
| - var expectedErrorCount = 4; |
| - |
| - function errorEvent(evt) |
| - { |
| - consoleWrite(""); |
| - |
| - var ndx; |
| - for (ndx = 0; ndx < sources.length; ndx++) { |
| - if (sources[ndx] == evt.target) |
| - break; |
| - } |
| - |
| - var src = sources[ndx].getAttribute('src') == null ? "null" : "'" + relativeURL(evt.target.src) + "'"; |
| - if (sources[ndx] == evt.target) |
| - logResult(true, "EVENT(error) from <source id='<em>" + evt.target.id + "</em>' src=<em>" + src + "</em>>"); |
| - else |
| - logResult(false, "EVENT(error) from " + evt.target); |
| - |
| - testExpected("video.error", null); |
| - |
| - if (++errorCount == expectedErrorCount) { |
| - consoleWrite(""); |
| - setTimeout(endTest, 200); |
| - } |
| - } |
| - |
| - function start() |
| - { |
| - document.addEventListener("error", errorEvent, true); |
| - |
| - sources = document.getElementsByTagName('source'); |
| - |
| - findMediaElement(); |
| - } |
| - </script> |
| - </head> |
| - |
| - <body> |
| - |
| - <video onloadstart="start()" controls> |
| - <source id=missing-src type="video/blahblah"> |
| - <source id=bogus-type src=content/test.ogv type="video/blahblah"> |
| - <source id=empty-src src="" type="video/ogg"> |
| - <source id=no-extension-no-type src=nonexistent> |
| - </video> |
| - |
| - <p>Test that 'error' events are fired from <source> element when it can not be used.</p> |
| - |
| - </body> |
| -</html> |
| +<!DOCTYPE html> |
| +<title>Test that "error" event is fired from "source" element when it can not be used.</title> |
| +<script src="../resources/testharness.js"></script> |
| +<script src="../resources/testharnessreport.js"></script> |
| +<video> |
| + <source id="missing-src" type="video/blahblah"></source> |
| + <source id="bogus-type" src="content/test.ogv" type="video/blahblah"></source> |
| + <source id="empty-src" src="" type="video/ogg"></source> |
| + <source id="no-extension-no-type" src="nonexistent"></source> |
| +</video> |
| +<script> |
| +async_test(function(t) { |
| + var errorCount = 0; |
| + document.addEventListener("error", function(event) { |
| + assert_true(event.target instanceof HTMLSourceElement); |
| + assert_equals(document.querySelector("video").error, null); |
| + |
| + if (++errorCount == 4) |
|
fs
2016/07/02 17:56:56
Maybe assert errorCount < 4 or similar around here
Srirama
2016/07/02 18:56:59
We need the if condition for settimeout to end tes
fs
2016/07/02 19:29:06
In addition to, yes.
Srirama
2016/07/03 03:46:09
Done.
|
| + setTimeout(t.step_func_done(), 200); |
| + }, true); |
| +}); |
| +</script> |