OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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.content.browser; | 5 package org.chromium.content.browser; |
6 | 6 |
7 import android.support.test.filters.LargeTest; | 7 import android.support.test.filters.LargeTest; |
8 | 8 |
9 import org.junit.Assert; | 9 import org.junit.Assert; |
10 import org.junit.Before; | 10 import org.junit.Before; |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 @Test | 89 @Test |
90 @LargeTest | 90 @LargeTest |
91 @Feature({"Navigation"}) | 91 @Feature({"Navigation"}) |
92 @RetryOnFailure | 92 @RetryOnFailure |
93 public void testCloseInterstitial() throws ExecutionException { | 93 public void testCloseInterstitial() throws ExecutionException { |
94 final String proceedCommand = "PROCEED"; | 94 final String proceedCommand = "PROCEED"; |
95 final String htmlContent = "<html>" | 95 final String htmlContent = "<html>" |
96 + "<head>" | 96 + "<head>" |
97 + " <script>" | 97 + " <script>" |
98 + " function sendCommand(command) {" | 98 + " function sendCommand(command) {" |
99 + " window.domAutomationController.setAutomationId(1);" | |
100 + " window.domAutomationController.send(command);" | 99 + " window.domAutomationController.send(command);" |
101 + " }" | 100 + " }" |
102 + " </script>" | 101 + " </script>" |
103 + "</head>" | 102 + "</head>" |
104 + "<body style='background-color:#FF0000' " | 103 + "<body style='background-color:#FF0000' " |
105 + " onclick='sendCommand(\"" + proceedCommand + "\");'>" | 104 + " onclick='sendCommand(\"" + proceedCommand + "\");'>" |
106 + " <h1>This is a scary interstitial page</h1>" | 105 + " <h1>This is a scary interstitial page</h1>" |
107 + "</body>" | 106 + "</body>" |
108 + "</html>"; | 107 + "</html>"; |
109 final InterstitialPageDelegateAndroid delegate = | 108 final InterstitialPageDelegateAndroid delegate = |
(...skipping 17 matching lines...) Expand all Loading... |
127 waitForInterstitial(true); | 126 waitForInterstitial(true); |
128 Assert.assertTrue("WebContentsObserver not notified of interstitial show
ing", | 127 Assert.assertTrue("WebContentsObserver not notified of interstitial show
ing", |
129 observer.isInterstitialShowing()); | 128 observer.isInterstitialShowing()); |
130 TouchCommon.singleClickView( | 129 TouchCommon.singleClickView( |
131 mActivityTestRule.getContentViewCore().getContainerView(), 10, 1
0); | 130 mActivityTestRule.getContentViewCore().getContainerView(), 10, 1
0); |
132 waitForInterstitial(false); | 131 waitForInterstitial(false); |
133 Assert.assertTrue("WebContentsObserver not notified of interstitial hidi
ng", | 132 Assert.assertTrue("WebContentsObserver not notified of interstitial hidi
ng", |
134 !observer.isInterstitialShowing()); | 133 !observer.isInterstitialShowing()); |
135 } | 134 } |
136 } | 135 } |
OLD | NEW |