OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 package org.chromium.chrome.browser.video; |
| 6 |
| 7 import android.test.FlakyTest; |
| 8 |
| 9 import org.chromium.chrome.browser.ChromeActivity; |
| 10 import org.chromium.chrome.browser.Tab; |
| 11 import org.chromium.chrome.test.ChromeActivityTestCaseBase; |
| 12 import org.chromium.chrome.test.util.TestHttpServerClient; |
| 13 import org.chromium.chrome.test.util.browser.TabTitleObserver; |
| 14 import org.chromium.content.browser.test.util.DOMUtils; |
| 15 |
| 16 import java.util.concurrent.TimeoutException; |
| 17 |
| 18 /** |
| 19 * Simple tests of html5 video. |
| 20 */ |
| 21 public class VideoTest extends ChromeActivityTestCaseBase<ChromeActivity> { |
| 22 |
| 23 public VideoTest() { |
| 24 super(ChromeActivity.class); |
| 25 } |
| 26 |
| 27 /* |
| 28 * @LargeTest |
| 29 * @Feature({"Media", "Media-Video", "Main"}) |
| 30 */ |
| 31 @FlakyTest |
| 32 public void testLoadMediaUrl() throws InterruptedException, TimeoutException
{ |
| 33 Tab tab = getActivity().getActivityTab(); |
| 34 TabTitleObserver titleObserver = new TabTitleObserver(tab, "ready_to_pla
y"); |
| 35 loadUrl(TestHttpServerClient.getUrl("chrome/test/data/android/media/vide
o-play.html")); |
| 36 titleObserver.waitForTitleUpdate(5); |
| 37 assertEquals("ready_to_play", tab.getTitle()); |
| 38 |
| 39 titleObserver = new TabTitleObserver(tab, "ended"); |
| 40 DOMUtils.clickNode(this, tab.getContentViewCore(), "button1"); |
| 41 // Now the video will play for 5 secs. |
| 42 // Makes sure that the video ends and title was changed. |
| 43 titleObserver.waitForTitleUpdate(15); |
| 44 assertEquals("ended", tab.getTitle()); |
| 45 } |
| 46 |
| 47 @Override |
| 48 public void startMainActivity() throws InterruptedException { |
| 49 startMainActivityOnBlankPage(); |
| 50 } |
| 51 } |
OLD | NEW |