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

Side by Side 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 unified diff | Download patch
OLDNEW
(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;
6
7 import android.test.FlakyTest;
8
9 import org.chromium.chrome.test.ChromeActivityTestCaseBase;
10 import org.chromium.chrome.test.util.TestHttpServerClient;
11 import org.chromium.chrome.test.util.browser.TabTitleObserver;
12 import org.chromium.content.browser.test.util.DOMUtils;
13
14 import java.util.concurrent.TimeoutException;
15
16 /**
17 * Simple HTML5 audio tests.
18 */
19 public class AudioTest extends ChromeActivityTestCaseBase<ChromeActivity> {
20
21 public AudioTest() {
22 super(ChromeActivity.class);
23 }
24
25 /**
26 * Test playing a small mp3 audio file.
27 * http://crbug.com/331122
28 * @Feature({"Media", "Media-Audio", "Main"})
29 * @MediumTest
30 */
31 @FlakyTest
32 public void testPlayMp3() 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/mp3- 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
42 // Make sure that the audio playback "ended" and title is changed.
43 titleObserver.waitForTitleUpdate(15);
44 assertEquals("ended", tab.getTitle());
45 }
46
47 @Override
48 public void startMainActivity() throws InterruptedException {
49 startMainActivityOnBlankPage();
50 }
51 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698