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; |
11 import org.chromium.android_webview.test.util.VideoTestWebServer; | 11 import org.chromium.android_webview.test.util.VideoTestWebServer; |
| 12 import org.chromium.base.test.util.DisabledTest; |
12 import org.chromium.base.test.util.Feature; | 13 import org.chromium.base.test.util.Feature; |
13 import org.chromium.content.browser.test.util.CallbackHelper; | 14 import org.chromium.content.browser.test.util.CallbackHelper; |
14 import org.chromium.content.browser.test.util.TouchCommon; | 15 import org.chromium.content.browser.test.util.TouchCommon; |
15 | 16 |
16 import java.util.concurrent.TimeUnit; | 17 import java.util.concurrent.TimeUnit; |
17 import java.util.concurrent.TimeoutException; | 18 import java.util.concurrent.TimeoutException; |
18 | 19 |
19 /** | 20 /** |
20 * Test for AwContentClient.GetVideoLoadingProgressView. | 21 * Test for AwContentClient.GetVideoLoadingProgressView. |
21 * | 22 * |
(...skipping 16 matching lines...) Expand all Loading... |
38 | 39 |
39 @Override | 40 @Override |
40 public void onViewDetachedFromWindow(View arg0) { | 41 public void onViewDetachedFromWindow(View arg0) { |
41 } | 42 } |
42 | 43 |
43 private void waitForViewAttached() throws InterruptedException, TimeoutExcep
tion { | 44 private void waitForViewAttached() throws InterruptedException, TimeoutExcep
tion { |
44 mViewAttachedCallbackHelper.waitForCallback(0, 1, 20, TimeUnit.SECONDS); | 45 mViewAttachedCallbackHelper.waitForCallback(0, 1, 20, TimeUnit.SECONDS); |
45 } | 46 } |
46 | 47 |
47 | 48 |
48 @Feature({"AndroidWebView"}) | 49 /** |
49 @SmallTest | 50 * @Feature({"AndroidWebView"}) |
| 51 * @SmallTest |
| 52 * |
| 53 * http://crbug.com/238735 |
| 54 */ |
| 55 @DisabledTest |
50 public void testGetVideoLoadingProgressView() throws Throwable { | 56 public void testGetVideoLoadingProgressView() throws Throwable { |
51 TestAwContentsClient contentsClient = | 57 TestAwContentsClient contentsClient = |
52 new FullScreenVideoTestAwContentsClient(getActivity()) { | 58 new FullScreenVideoTestAwContentsClient(getActivity()) { |
53 @Override | 59 @Override |
54 protected View getVideoLoadingProgressView() { | 60 protected View getVideoLoadingProgressView() { |
55 View view = new View(getInstrumentation().getTargetContext()); | 61 View view = new View(getInstrumentation().getTargetContext()); |
56 view.addOnAttachStateChangeListener( | 62 view.addOnAttachStateChangeListener( |
57 AwContentsClientGetVideoLoadingProgressViewTest.this); | 63 AwContentsClientGetVideoLoadingProgressViewTest.this); |
58 return view; | 64 return view; |
59 } | 65 } |
60 }; | 66 }; |
61 final AwTestContainerView testContainerView = | 67 final AwTestContainerView testContainerView = |
62 createAwTestContainerViewOnMainSync(contentsClient); | 68 createAwTestContainerViewOnMainSync(contentsClient); |
63 final AwContents awContents = testContainerView.getAwContents(); | 69 final AwContents awContents = testContainerView.getAwContents(); |
64 enableJavaScriptOnUiThread(awContents); | 70 enableJavaScriptOnUiThread(awContents); |
65 VideoTestWebServer webServer = new VideoTestWebServer( | 71 VideoTestWebServer webServer = new VideoTestWebServer( |
66 getInstrumentation().getTargetContext()); | 72 getInstrumentation().getTargetContext()); |
67 try { | 73 try { |
68 loadUrlSync(awContents, contentsClient.getOnPageFinishedHelper(), | 74 loadUrlSync(awContents, contentsClient.getOnPageFinishedHelper(), |
69 webServer.getFullScreenVideoTestURL()); | 75 webServer.getFullScreenVideoTestURL()); |
70 Thread.sleep(5 * 1000); | 76 Thread.sleep(5 * 1000); |
71 TouchCommon touchCommon = new TouchCommon(this); | 77 TouchCommon touchCommon = new TouchCommon(this); |
72 touchCommon.singleClickView(testContainerView); | 78 touchCommon.singleClickView(testContainerView); |
73 waitForViewAttached(); | 79 waitForViewAttached(); |
74 } finally { | 80 } finally { |
75 if (webServer != null) webServer.getTestWebServer().shutdown(); | 81 if (webServer != null) webServer.getTestWebServer().shutdown(); |
76 } | 82 } |
77 } | 83 } |
78 } | 84 } |
OLD | NEW |