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

Unified Diff: chrome/android/javatests/src/org/chromium/chrome/browser/AudioTest.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/AudioTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/AudioTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/AudioTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..aca16c32bfb2dc1c2b27f9b7167dde91690d4ef6
--- /dev/null
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/AudioTest.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;
+
+import android.test.FlakyTest;
+
+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 HTML5 audio tests.
+ */
+public class AudioTest extends ChromeActivityTestCaseBase<ChromeActivity> {
+
+ public AudioTest() {
+ super(ChromeActivity.class);
+ }
+
+ /**
+ * Test playing a small mp3 audio file.
+ * http://crbug.com/331122
+ * @Feature({"Media", "Media-Audio", "Main"})
+ * @MediumTest
+ */
+ @FlakyTest
+ public void testPlayMp3() throws InterruptedException, TimeoutException {
+ Tab tab = getActivity().getActivityTab();
+ TabTitleObserver titleObserver = new TabTitleObserver(tab, "ready_to_play");
+ loadUrl(TestHttpServerClient.getUrl("chrome/test/data/android/media/mp3-play.html"));
+ titleObserver.waitForTitleUpdate(5);
+ assertEquals("ready_to_play", tab.getTitle());
+
+ titleObserver = new TabTitleObserver(tab, "ended");
+ DOMUtils.clickNode(this, tab.getContentViewCore(), "button1");
+
+ // Make sure that the audio playback "ended" and title is changed.
+ titleObserver.waitForTitleUpdate(15);
+ assertEquals("ended", tab.getTitle());
+ }
+
+ @Override
+ public void startMainActivity() throws InterruptedException {
+ startMainActivityOnBlankPage();
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698