1 // Copyright (c) 2013 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.
5 package org.chromium.android_webview.test;
7 import android.test.suitebuilder.annotation.SmallTest;
8 import android.view.KeyEvent;
10 import org.chromium.android_webview.test.util.VideoTestWebServer;
11 import org.chromium.base.test.util.DisabledTest;
12 import org.chromium.base.test.util.Feature;
13 import org.chromium.content.browser.test.util.TouchCommon;
16 * Test WebChromeClient::onShow/HideCustomView.
18 public class AwContentsClientFullScreenVideoTest extends AwTestBase {
21 * @Feature({"AndroidWebView"})
24 * http://crbug.com/238735
27 public void testOnShowAndHideCustomView() throws Throwable {
28 FullScreenVideoTestAwContentsClient contentsClient =
29 new FullScreenVideoTestAwContentsClient(getActivity());
30 AwTestContainerView testContainerView =
31 createAwTestContainerViewOnMainSync(contentsClient);
32 enableJavaScriptOnUiThread(testContainerView.getAwContents());
33 VideoTestWebServer webServer = new VideoTestWebServer(
34 getInstrumentation().getTargetContext());
36 loadUrlSync(testContainerView.getAwContents(),
37 contentsClient.getOnPageFinishedHelper(),
38 webServer.getFullScreenVideoTestURL());
39 Thread.sleep(5 * 1000);
40 TouchCommon touchCommon = new TouchCommon(this);
41 touchCommon.singleClickView(testContainerView);
42 contentsClient.waitForCustomViewShown();
43 getInstrumentation().sendKeyDownUpSync(KeyEvent.KEYCODE_BACK);
44 contentsClient.waitForCustomViewHidden();
47 if (webServer != null) webServer.getTestWebServer().shutdown();