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

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

Issue 1414403002: Add CommandLineArgumentParameter and use it for WebView tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix-cr-526885-read-nested-annotations
Patch Set: Comments addressed Created 5 years, 1 month 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.test.suitebuilder.annotation.MediumTest; 7 import android.test.suitebuilder.annotation.MediumTest;
8 8
9 import org.chromium.android_webview.AwContents; 9 import org.chromium.android_webview.AwContents;
10 import org.chromium.android_webview.test.util.CommonResources; 10 import org.chromium.android_webview.test.util.CommonResources;
11 import org.chromium.android_webview.test.util.JSUtils; 11 import org.chromium.android_webview.test.util.JSUtils;
12 import org.chromium.base.test.util.Feature; 12 import org.chromium.base.test.util.Feature;
13 import org.chromium.base.test.util.parameter.ParameterizedTest;
13 import org.chromium.content.browser.test.util.TestCallbackHelperContainer; 14 import org.chromium.content.browser.test.util.TestCallbackHelperContainer;
14 import org.chromium.net.test.util.TestWebServer; 15 import org.chromium.net.test.util.TestWebServer;
15 16
16 import java.util.concurrent.CountDownLatch; 17 import java.util.concurrent.CountDownLatch;
17 18
18 /** 19 /**
19 * Tests for the ContentViewClient.onPageFinished() method. 20 * Tests for the ContentViewClient.onPageFinished() method.
20 */ 21 */
21 public class ClientOnPageFinishedTest extends AwTestBase { 22 public class ClientOnPageFinishedTest extends AwTestBase {
22 23
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 onPageFinishedHelper.waitForCallback(currentOnPageFinishedCallCount) ; 142 onPageFinishedHelper.waitForCallback(currentOnPageFinishedCallCount) ;
142 // onPageFinished needs to be called for redirectTargetUrl, but not for redirectUrl 143 // onPageFinished needs to be called for redirectTargetUrl, but not for redirectUrl
143 assertEquals(redirectTargetUrl, onPageFinishedHelper.getUrl()); 144 assertEquals(redirectTargetUrl, onPageFinishedHelper.getUrl());
144 } finally { 145 } finally {
145 webServer.shutdown(); 146 webServer.shutdown();
146 } 147 }
147 } 148 }
148 149
149 @MediumTest 150 @MediumTest
150 @Feature({"AndroidWebView"}) 151 @Feature({"AndroidWebView"})
152 // Run in single-process mode only. Blocked by multiple RVHs crbug.com/53351 6.
153 @ParameterizedTest.Set
151 public void testNotCalledForValidSubresources() throws Throwable { 154 public void testNotCalledForValidSubresources() throws Throwable {
152 TestCallbackHelperContainer.OnPageFinishedHelper onPageFinishedHelper = 155 TestCallbackHelperContainer.OnPageFinishedHelper onPageFinishedHelper =
153 mContentsClient.getOnPageFinishedHelper(); 156 mContentsClient.getOnPageFinishedHelper();
154 157
155 TestWebServer webServer = TestWebServer.start(); 158 TestWebServer webServer = TestWebServer.start();
156 try { 159 try {
157 final String testHtml = "<html><head>Header</head><body>Body</body>< /html>"; 160 final String testHtml = "<html><head>Header</head><body>Body</body>< /html>";
158 final String testPath = "/test.html"; 161 final String testPath = "/test.html";
159 final String syncPath = "/sync.html"; 162 final String syncPath = "/sync.html";
160 163
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 webServer.setResponse("/test.html", CommonResources.ABOUT_HT ML, null); 367 webServer.setResponse("/test.html", CommonResources.ABOUT_HT ML, null);
365 loadUrlSync(mAwContents, mContentsClient.getOnPageFinishedHelper(), testUrl); 368 loadUrlSync(mAwContents, mContentsClient.getOnPageFinishedHelper(), testUrl);
366 doTestOnPageFinishedNotCalledOnDomMutation(webServer, null); 369 doTestOnPageFinishedNotCalledOnDomMutation(webServer, null);
367 } finally { 370 } finally {
368 webServer.shutdown(); 371 webServer.shutdown();
369 } 372 }
370 } 373 }
371 374
372 @MediumTest 375 @MediumTest
373 @Feature({"AndroidWebView"}) 376 @Feature({"AndroidWebView"})
377 // Run in single-process mode only. Blocked by multiple RVHs crbug.com/53351 6.
378 @ParameterizedTest.Set
374 public void testNotCalledOnDomModificationAfterLoadData() 379 public void testNotCalledOnDomModificationAfterLoadData()
375 throws Throwable { 380 throws Throwable {
376 TestWebServer webServer = TestWebServer.start(); 381 TestWebServer webServer = TestWebServer.start();
377 try { 382 try {
378 loadDataSync(mAwContents, mContentsClient.getOnPageFinishedHelper(), 383 loadDataSync(mAwContents, mContentsClient.getOnPageFinishedHelper(),
379 CommonResources.ABOUT_HTML, "text/html", false); 384 CommonResources.ABOUT_HTML, "text/html", false);
380 doTestOnPageFinishedNotCalledOnDomMutation(webServer, null); 385 doTestOnPageFinishedNotCalledOnDomMutation(webServer, null);
381 } finally { 386 } finally {
382 webServer.shutdown(); 387 webServer.shutdown();
383 } 388 }
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 mContentsClient.getOnPageFinishedHelper(); 420 mContentsClient.getOnPageFinishedHelper();
416 int currentCallCount = onPageFinishedHelper.getCallCount(); 421 int currentCallCount = onPageFinishedHelper.getCallCount();
417 loadUrlAsync(mAwContents, url); 422 loadUrlAsync(mAwContents, url);
418 onPageFinishedHelper.waitForCallback(currentCallCount); 423 onPageFinishedHelper.waitForCallback(currentCallCount);
419 assertEquals(url, onPageFinishedHelper.getUrl()); 424 assertEquals(url, onPageFinishedHelper.getUrl());
420 } finally { 425 } finally {
421 webServer.shutdown(); 426 webServer.shutdown();
422 } 427 }
423 } 428 }
424 } 429 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698