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

Side by Side Diff: components/cronet/android/test/javatests/src/org/chromium/net/CronetUrlRequestTest.java

Issue 2777313002: Fix Cronet Android test after 755221e53 (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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.net; 5 package org.chromium.net;
6 6
7 import android.os.Build; 7 import android.os.Build;
8 import android.os.ConditionVariable; 8 import android.os.ConditionVariable;
9 import android.os.StrictMode; 9 import android.os.StrictMode;
10 import android.support.test.filters.SmallTest; 10 import android.support.test.filters.SmallTest;
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 headers[i], headers[i + 1])); 147 headers[i], headers[i + 1]));
148 } 148 }
149 UrlResponseInfoImpl unknown = new UrlResponseInfoImpl( 149 UrlResponseInfoImpl unknown = new UrlResponseInfoImpl(
150 Arrays.asList(urls), statusCode, message, headersList, false, "u nknown", ":0"); 150 Arrays.asList(urls), statusCode, message, headersList, false, "u nknown", ":0");
151 unknown.setReceivedByteCount(receivedBytes); 151 unknown.setReceivedByteCount(receivedBytes);
152 return unknown; 152 return unknown;
153 } 153 }
154 154
155 void runConnectionMigrationTest(boolean disableConnectionMigration) { 155 void runConnectionMigrationTest(boolean disableConnectionMigration) {
156 // URLRequest load flags at net/base/load_flags_list.h. 156 // URLRequest load flags at net/base/load_flags_list.h.
157 int connectionMigrationLoadFlag = 1 << 18; 157 int connectionMigrationLoadFlag = 1 << 17;
158 TestUrlRequestCallback callback = new TestUrlRequestCallback(); 158 TestUrlRequestCallback callback = new TestUrlRequestCallback();
159 callback.setAutoAdvance(false); 159 callback.setAutoAdvance(false);
160 // Create builder, start a request, and check if default load_flags are set correctly. 160 // Create builder, start a request, and check if default load_flags are set correctly.
161 ExperimentalUrlRequest.Builder builder = 161 ExperimentalUrlRequest.Builder builder =
162 (ExperimentalUrlRequest.Builder) mTestFramework.mCronetEngine.ne wUrlRequestBuilder( 162 (ExperimentalUrlRequest.Builder) mTestFramework.mCronetEngine.ne wUrlRequestBuilder(
163 NativeTestServer.getFileURL("/success.txt"), callback, 163 NativeTestServer.getFileURL("/success.txt"), callback,
164 callback.getExecutor()); 164 callback.getExecutor());
165 // Disable connection migration. 165 // Disable connection migration.
166 if (disableConnectionMigration) builder.disableConnectionMigration(); 166 if (disableConnectionMigration) builder.disableConnectionMigration();
167 UrlRequest urlRequest = builder.build(); 167 UrlRequest urlRequest = builder.build();
(...skipping 1944 matching lines...) Expand 10 before | Expand all | Expand 10 after
2112 // cleartext. 2112 // cleartext.
2113 final String url = "http://example.com/simple.txt"; 2113 final String url = "http://example.com/simple.txt";
2114 TestUrlRequestCallback callback = startAndWaitForComplete(url); 2114 TestUrlRequestCallback callback = startAndWaitForComplete(url);
2115 assertNull(callback.mResponseInfo); 2115 assertNull(callback.mResponseInfo);
2116 assertNotNull(callback.mError); 2116 assertNotNull(callback.mError);
2117 assertEquals(cleartextNotPermitted, 2117 assertEquals(cleartextNotPermitted,
2118 ((NetworkException) callback.mError).getCronetInternalErrorC ode()); 2118 ((NetworkException) callback.mError).getCronetInternalErrorC ode());
2119 } 2119 }
2120 } 2120 }
2121 } 2121 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698