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

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

Issue 2548013002: Remove redundant field initialization in Java code. (Closed)
Patch Set: rebase Created 4 years 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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.util.Pair; 8 import android.util.Pair;
9 9
10 import org.chromium.android_webview.AwContents; 10 import org.chromium.android_webview.AwContents;
(...skipping 25 matching lines...) Expand all
36 mTestContainerView = createAwTestContainerViewOnMainSync(mContentsClient ); 36 mTestContainerView = createAwTestContainerViewOnMainSync(mContentsClient );
37 mAwContents = mTestContainerView.getAwContents(); 37 mAwContents = mTestContainerView.getAwContents();
38 mWebServer = TestWebServer.start(); 38 mWebServer = TestWebServer.start();
39 } 39 }
40 40
41 private void useDefaultTestAwContentsClient() throws Exception { 41 private void useDefaultTestAwContentsClient() throws Exception {
42 mContentsClient.enableBypass(); 42 mContentsClient.enableBypass();
43 } 43 }
44 44
45 private static class VerifyOnReceivedHttpErrorCallClient extends TestAwConte ntsClient { 45 private static class VerifyOnReceivedHttpErrorCallClient extends TestAwConte ntsClient {
46 private boolean mBypass = false; 46 private boolean mBypass;
47 private boolean mIsOnPageFinishedCalled = false; 47 private boolean mIsOnPageFinishedCalled;
48 private boolean mIsOnReceivedHttpErrorCalled = false; 48 private boolean mIsOnReceivedHttpErrorCalled;
49 49
50 void enableBypass() { 50 void enableBypass() {
51 mBypass = true; 51 mBypass = true;
52 } 52 }
53 53
54 @Override 54 @Override
55 public void onPageFinished(String url) { 55 public void onPageFinished(String url) {
56 if (!mBypass) { 56 if (!mBypass) {
57 assertEquals( 57 assertEquals(
58 "onPageFinished called twice for " + url, false, mIsOnPa geFinishedCalled); 58 "onPageFinished called twice for " + url, false, mIsOnPa geFinishedCalled);
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 AwWebResourceResponse response = onReceivedHttpErrorHelper.getResponse() ; 231 AwWebResourceResponse response = onReceivedHttpErrorHelper.getResponse() ;
232 assertEquals(404, response.getStatusCode()); 232 assertEquals(404, response.getStatusCode());
233 assertEquals("Not Found", response.getReasonPhrase()); 233 assertEquals("Not Found", response.getReasonPhrase());
234 assertEquals("text/html", response.getMimeType()); 234 assertEquals("text/html", response.getMimeType());
235 assertEquals("utf-8", response.getCharset()); 235 assertEquals("utf-8", response.getCharset());
236 assertNotNull(response.getResponseHeaders()); 236 assertNotNull(response.getResponseHeaders());
237 assertTrue(response.getResponseHeaders().containsKey("Content-Type")); 237 assertTrue(response.getResponseHeaders().containsKey("Content-Type"));
238 assertEquals("text/html; charset=utf-8", response.getResponseHeaders().g et("Content-Type")); 238 assertEquals("text/html; charset=utf-8", response.getResponseHeaders().g et("Content-Type"));
239 } 239 }
240 } 240 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698