| OLD | NEW |
| 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.test.AndroidTestCase; | 7 import android.test.AndroidTestCase; |
| 8 | 8 |
| 9 import org.chromium.base.ContextUtils; | 9 import org.chromium.base.ContextUtils; |
| 10 import org.chromium.base.PathUtils; | 10 import org.chromium.base.PathUtils; |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 assertEquals(expected.getUrl(), actual.getUrl()); | 159 assertEquals(expected.getUrl(), actual.getUrl()); |
| 160 // Transferred bytes and proxy server are not supported in pure java | 160 // Transferred bytes and proxy server are not supported in pure java |
| 161 if (!(mCronetTestFramework.mCronetEngine instanceof JavaCronetEngine)) { | 161 if (!(mCronetTestFramework.mCronetEngine instanceof JavaCronetEngine)) { |
| 162 assertEquals(expected.getReceivedBytesCount(), actual.getReceivedByt
esCount()); | 162 assertEquals(expected.getReceivedBytesCount(), actual.getReceivedByt
esCount()); |
| 163 assertEquals(expected.getProxyServer(), actual.getProxyServer()); | 163 assertEquals(expected.getProxyServer(), actual.getProxyServer()); |
| 164 // This is a place where behavior intentionally differs between nati
ve and java | 164 // This is a place where behavior intentionally differs between nati
ve and java |
| 165 assertEquals(expected.getNegotiatedProtocol(), actual.getNegotiatedP
rotocol()); | 165 assertEquals(expected.getNegotiatedProtocol(), actual.getNegotiatedP
rotocol()); |
| 166 } | 166 } |
| 167 } | 167 } |
| 168 | 168 |
| 169 static void assertContains(String expectedSubstring, String actualString) { |
| 170 assertNotNull(actualString); |
| 171 if (!actualString.contains(expectedSubstring)) { |
| 172 fail("String [" + actualString + "] doesn't contain substring [" + e
xpectedSubstring |
| 173 + "]"); |
| 174 } |
| 175 } |
| 176 |
| 169 @Target(ElementType.METHOD) | 177 @Target(ElementType.METHOD) |
| 170 @Retention(RetentionPolicy.RUNTIME) | 178 @Retention(RetentionPolicy.RUNTIME) |
| 171 public @interface CompareDefaultWithCronet { | 179 public @interface CompareDefaultWithCronet { |
| 172 } | 180 } |
| 173 | 181 |
| 174 @Target(ElementType.METHOD) | 182 @Target(ElementType.METHOD) |
| 175 @Retention(RetentionPolicy.RUNTIME) | 183 @Retention(RetentionPolicy.RUNTIME) |
| 176 public @interface OnlyRunCronetHttpURLConnection { | 184 public @interface OnlyRunCronetHttpURLConnection { |
| 177 } | 185 } |
| 178 | 186 |
| 179 @Target(ElementType.METHOD) | 187 @Target(ElementType.METHOD) |
| 180 @Retention(RetentionPolicy.RUNTIME) | 188 @Retention(RetentionPolicy.RUNTIME) |
| 181 public @interface OnlyRunNativeCronet {} | 189 public @interface OnlyRunNativeCronet {} |
| 182 } | 190 } |
| OLD | NEW |