OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.distiller.webdocument; | 5 package org.chromium.distiller.webdocument; |
6 | 6 |
7 import org.chromium.distiller.DomDistillerJsTestCase; | 7 import org.chromium.distiller.DomDistillerJsTestCase; |
8 import org.chromium.distiller.TestUtil; | |
9 | 8 |
10 import com.google.gwt.dom.client.Document; | 9 import com.google.gwt.dom.client.Document; |
11 import com.google.gwt.dom.client.Element; | 10 import com.google.gwt.dom.client.Element; |
12 import com.google.gwt.dom.client.Node; | |
13 | |
14 import java.util.List; | |
15 | 11 |
16 public class WebVideoTest extends DomDistillerJsTestCase { | 12 public class WebVideoTest extends DomDistillerJsTestCase { |
17 public void testGenerateOutput() { | 13 public void testGenerateOutput() { |
18 Element video = Document.get().createVideoElement(); | 14 Element video = Document.get().createVideoElement(); |
19 Element child = Document.get().createElement("source"); | 15 Element child = Document.get().createElement("source"); |
20 child.setAttribute("src", "http://example.com/foo.ogg"); | 16 child.setAttribute("src", "http://example.com/foo.ogg"); |
21 video.appendChild(child); | 17 video.appendChild(child); |
22 | 18 |
23 child = Document.get().createElement("track"); | 19 child = Document.get().createElement("track"); |
24 child.setAttribute("src", "http://example.com/foo.vtt"); | 20 child.setAttribute("src", "http://example.com/foo.vtt"); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 // Output should ignore anything other than "track" and "source" tags. | 58 // Output should ignore anything other than "track" and "source" tags. |
63 assertEquals(want, got); | 59 assertEquals(want, got); |
64 } | 60 } |
65 | 61 |
66 public void testPosterEmpty() { | 62 public void testPosterEmpty() { |
67 Element video = Document.get().createVideoElement(); | 63 Element video = Document.get().createVideoElement(); |
68 | 64 |
69 String want = "<video></video>"; | 65 String want = "<video></video>"; |
70 WebVideo webVideo = new WebVideo(video, 400, 300); | 66 WebVideo webVideo = new WebVideo(video, 400, 300); |
71 | 67 |
72 | 68 |
73 String got = webVideo.generateOutput(false); | 69 String got = webVideo.generateOutput(false); |
74 | 70 |
75 assertEquals(want, got); | 71 assertEquals(want, got); |
76 } | 72 } |
77 | 73 |
78 } | 74 } |
OLD | NEW |