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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/media/pdf-served-as-pdf.html

Issue 2167743002: Convert media-document* and pdf* tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add suggested change Created 4 years, 5 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 unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <title>Tests that a PDF file is served as "application/pdf"</title>
3 <head> 3 <script src="../resources/testharness.js"></script>
4 <title>PDF file served as 'application/pdf'</title> 4 <script src="../resources/testharnessreport.js"></script>
5 <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956 5 <script src="../../media-resources/media-file.js"></script>
6 (Please avoid writing new tests using video-test.js) --> 6 <video></video>
7 <script src=../../media-resources/video-test.js></script> 7 <script>
8 <script> 8 async_test(function(t) {
9 function loadedmetadata(evt) 9 var video = document.querySelector("video");
10 {
11 logResult(false, "loaded PDF file served as PDF");
12 endTest();
13 }
14 10
15 function error(evt) 11 var watcher = new EventWatcher(t, video, ["loadstart", "loadedmetadata", "er ror"]);
16 { 12 watcher.wait_for(["loadstart", "error"]).then(t.step_func_done());
17 logResult(true, "failed trying to load PDF file served as PDF"); 13 assert_equals(video.error, null);
18 endTest();
19 }
20 14
21 function start() 15 var movie = "resources/test.pdf";
22 { 16 video.src = "http://127.0.0.1:8000/media/video-throttled-load.cgi?name=" + m ovie + "&throttle=99999&type=application/pdf";
23 findMediaElement(); 17 });
24 18 </script>
25 waitForEvent('loadedmetadata', loadedmetadata);
26 waitForEvent("error", error);
27 waitForEvent("loadstart");
28 testExpected("video.error", null);
29
30 var movie = "resources/test.pdf";
31 video.src = "http://127.0.0.1:8000/media/video-throttled-load.cg i?name=" + movie + "&throttle=99999&type=application/pdf";
32 }
33 </script>
34 </head>
35
36 <body onload="start()">
37 <video controls></video>
38 </body>
39 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698