Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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.android_webview.test; | 5 package org.chromium.android_webview.test; |
| 6 | 6 |
| 7 import android.test.suitebuilder.annotation.SmallTest; | 7 import android.test.suitebuilder.annotation.SmallTest; |
| 8 import android.view.View; | 8 import android.view.View; |
| 9 | 9 |
| 10 import org.chromium.android_webview.AwContents; | 10 import org.chromium.android_webview.AwContents; |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 39 @Override | 39 @Override |
| 40 public void onViewDetachedFromWindow(View arg0) { | 40 public void onViewDetachedFromWindow(View arg0) { |
| 41 } | 41 } |
| 42 | 42 |
| 43 private void waitForViewAttached() throws InterruptedException, TimeoutExcep tion { | 43 private void waitForViewAttached() throws InterruptedException, TimeoutExcep tion { |
| 44 mViewAttachedCallbackHelper.waitForCallback(0, 1, WAIT_TIMEOUT_MS, | 44 mViewAttachedCallbackHelper.waitForCallback(0, 1, WAIT_TIMEOUT_MS, |
| 45 TimeUnit.MILLISECONDS); | 45 TimeUnit.MILLISECONDS); |
| 46 } | 46 } |
| 47 | 47 |
| 48 | 48 |
| 49 @DisableHardwareAccelerationForTest | |
|
Ignacio Solla
2014/10/16 13:44:19
FYI: playing fullscreen video in the WebView requi
boliu
2014/10/16 15:16:07
We should add a test that video in software mode d
| |
| 50 @Feature({"AndroidWebView"}) | 49 @Feature({"AndroidWebView"}) |
| 51 @SmallTest | 50 @SmallTest |
| 52 public void testGetVideoLoadingProgressView() throws Throwable { | 51 public void testGetVideoLoadingProgressView() throws Throwable { |
| 53 TestAwContentsClient contentsClient = | 52 TestAwContentsClient contentsClient = |
| 54 new FullScreenVideoTestAwContentsClient(getActivity()) { | 53 new FullScreenVideoTestAwContentsClient(getActivity()) { |
| 55 @Override | 54 @Override |
| 56 protected View getVideoLoadingProgressView() { | 55 protected View getVideoLoadingProgressView() { |
| 57 View view = new View(getInstrumentation().getTargetConte xt()); | 56 View view = new View(getInstrumentation().getTargetConte xt()); |
| 58 view.addOnAttachStateChangeListener( | 57 view.addOnAttachStateChangeListener( |
| 59 AwContentsClientGetVideoLoadingProgressViewTest. this); | 58 AwContentsClientGetVideoLoadingProgressViewTest. this); |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 72 webServer.getFullScreenVideoTestURL()); | 71 webServer.getFullScreenVideoTestURL()); |
| 73 Thread.sleep(5 * 1000); | 72 Thread.sleep(5 * 1000); |
| 74 TouchCommon touchCommon = new TouchCommon(this); | 73 TouchCommon touchCommon = new TouchCommon(this); |
| 75 touchCommon.singleClickView(testContainerView); | 74 touchCommon.singleClickView(testContainerView); |
| 76 waitForViewAttached(); | 75 waitForViewAttached(); |
| 77 } finally { | 76 } finally { |
| 78 if (webServer != null) webServer.getTestWebServer().shutdown(); | 77 if (webServer != null) webServer.getTestWebServer().shutdown(); |
| 79 } | 78 } |
| 80 } | 79 } |
| 81 } | 80 } |
| OLD | NEW |