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

Side by Side Diff: android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientShouldInterceptRequestTest.java

Issue 2933623002: Create AwJUnit4ClassRunner AwActivityTestRule and convert AwContentsTest (Closed)
Patch Set: address bo's comments Created 3 years, 4 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
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.android_webview.test; 5 package org.chromium.android_webview.test;
6 6
7 import android.support.test.filters.SmallTest; 7 import android.support.test.filters.SmallTest;
8 import android.util.Pair; 8 import android.util.Pair;
9 9
10 import org.chromium.android_webview.AwContents; 10 import org.chromium.android_webview.AwContents;
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 CommonResources.makeHtmlPageWithSimplePostFormTo(pageToPostToUrl )); 207 CommonResources.makeHtmlPageWithSimplePostFormTo(pageToPostToUrl ));
208 enableJavaScriptOnUiThread(mAwContents); 208 enableJavaScriptOnUiThread(mAwContents);
209 209
210 int callCount = mShouldInterceptRequestHelper.getCallCount(); 210 int callCount = mShouldInterceptRequestHelper.getCallCount();
211 loadUrlAsync(mAwContents, pageWithFormUrl); 211 loadUrlAsync(mAwContents, pageWithFormUrl);
212 mShouldInterceptRequestHelper.waitForCallback(callCount); 212 mShouldInterceptRequestHelper.waitForCallback(callCount);
213 assertEquals("GET", 213 assertEquals("GET",
214 mShouldInterceptRequestHelper.getRequestsForUrl(pageWithFormUrl) .method); 214 mShouldInterceptRequestHelper.getRequestsForUrl(pageWithFormUrl) .method);
215 215
216 callCount = mShouldInterceptRequestHelper.getCallCount(); 216 callCount = mShouldInterceptRequestHelper.getCallCount();
217 JSUtils.clickOnLinkUsingJs(this, mAwContents, 217 JSUtils.clickOnLinkUsingJs(getInstrumentation(), mAwContents,
218 mContentsClient.getOnEvaluateJavaScriptResultHelper(), "link"); 218 mContentsClient.getOnEvaluateJavaScriptResultHelper(), "link");
219 mShouldInterceptRequestHelper.waitForCallback(callCount); 219 mShouldInterceptRequestHelper.waitForCallback(callCount);
220 assertEquals("POST", 220 assertEquals("POST",
221 mShouldInterceptRequestHelper.getRequestsForUrl(pageToPostToUrl) .method); 221 mShouldInterceptRequestHelper.getRequestsForUrl(pageToPostToUrl) .method);
222 } 222 }
223 223
224 @SmallTest 224 @SmallTest
225 @Feature({"AndroidWebView"}) 225 @Feature({"AndroidWebView"})
226 public void testCalledWithCorrectHasUserGestureParam() throws Throwable { 226 public void testCalledWithCorrectHasUserGestureParam() throws Throwable {
227 final String aboutPageUrl = addAboutPageToTestServer(mWebServer); 227 final String aboutPageUrl = addAboutPageToTestServer(mWebServer);
(...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after
910 CommonResources.makeHtmlPageFrom( 910 CommonResources.makeHtmlPageFrom(
911 "", "<iframe src=\'" + iframeContentIdUrl + "\'></iframe >")); 911 "", "<iframe src=\'" + iframeContentIdUrl + "\'></iframe >"));
912 912
913 int callCount = mShouldInterceptRequestHelper.getCallCount(); 913 int callCount = mShouldInterceptRequestHelper.getCallCount();
914 loadUrlAsync(mAwContents, pageUrl); 914 loadUrlAsync(mAwContents, pageUrl);
915 mShouldInterceptRequestHelper.waitForCallback(callCount, 2); 915 mShouldInterceptRequestHelper.waitForCallback(callCount, 2);
916 assertEquals(2, mShouldInterceptRequestHelper.getUrls().size()); 916 assertEquals(2, mShouldInterceptRequestHelper.getUrls().size());
917 assertEquals(iframeContentIdUrl, mShouldInterceptRequestHelper.getUrls() .get(1)); 917 assertEquals(iframeContentIdUrl, mShouldInterceptRequestHelper.getUrls() .get(1));
918 } 918 }
919 } 919 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698