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

Unified Diff: chrome/android/javatests/src/org/chromium/chrome/browser/video/VideoTest.java

Issue 1141283003: Upstream oodles of Chrome for Android code into Chromium. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: final patch? Created 5 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: chrome/android/javatests/src/org/chromium/chrome/browser/video/VideoTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/video/VideoTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/video/VideoTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..37257ee6174667f7f4fc2c48dde7c318e7774041
--- /dev/null
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/video/VideoTest.java
@@ -0,0 +1,51 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.chrome.browser.video;
+
+import android.test.FlakyTest;
+
+import org.chromium.chrome.browser.ChromeActivity;
+import org.chromium.chrome.browser.Tab;
+import org.chromium.chrome.test.ChromeActivityTestCaseBase;
+import org.chromium.chrome.test.util.TestHttpServerClient;
+import org.chromium.chrome.test.util.browser.TabTitleObserver;
+import org.chromium.content.browser.test.util.DOMUtils;
+
+import java.util.concurrent.TimeoutException;
+
+/**
+ * Simple tests of html5 video.
+ */
+public class VideoTest extends ChromeActivityTestCaseBase<ChromeActivity> {
+
+ public VideoTest() {
+ super(ChromeActivity.class);
+ }
+
+ /*
+ * @LargeTest
+ * @Feature({"Media", "Media-Video", "Main"})
+ */
+ @FlakyTest
+ public void testLoadMediaUrl() throws InterruptedException, TimeoutException {
+ Tab tab = getActivity().getActivityTab();
+ TabTitleObserver titleObserver = new TabTitleObserver(tab, "ready_to_play");
+ loadUrl(TestHttpServerClient.getUrl("chrome/test/data/android/media/video-play.html"));
+ titleObserver.waitForTitleUpdate(5);
+ assertEquals("ready_to_play", tab.getTitle());
+
+ titleObserver = new TabTitleObserver(tab, "ended");
+ DOMUtils.clickNode(this, tab.getContentViewCore(), "button1");
+ // Now the video will play for 5 secs.
+ // Makes sure that the video ends and title was changed.
+ titleObserver.waitForTitleUpdate(15);
+ assertEquals("ended", tab.getTitle());
+ }
+
+ @Override
+ public void startMainActivity() throws InterruptedException {
+ startMainActivityOnBlankPage();
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698