Chromium Code Reviews| Index: components/cronet/android/test/src/org/chromium/cronet_test_apk/MockUrlRequestJobFactory.java |
| diff --git a/components/cronet/android/test/src/org/chromium/cronet_test_apk/MockUrlRequestJobFactory.java b/components/cronet/android/test/src/org/chromium/cronet_test_apk/MockUrlRequestJobFactory.java |
| index 1cabb871c2d838c73a48dfef26d1fc88159b85d6..f2dbb013767a5ea3670e3c8982603081b7d133ee 100644 |
| --- a/components/cronet/android/test/src/org/chromium/cronet_test_apk/MockUrlRequestJobFactory.java |
| +++ b/components/cronet/android/test/src/org/chromium/cronet_test_apk/MockUrlRequestJobFactory.java |
| @@ -109,6 +109,20 @@ public final class MockUrlRequestJobFactory { |
| } |
| /** |
| + * Constructs a mock URL that synchronously responds with data repeated many |
| + * times. |
| + * |
| + * @param data to return in response. |
| + * @param dataRepeatCount number of times to repeat the data. |
| + */ |
| + public String getMockUrlForData(String data, int dataRepeatCount) { |
|
mmenke
2014/12/10 20:59:14
Helen did some refactoring here, you'll need to me
mef
2014/12/10 23:23:35
Done.
|
| + if (!mInstallCompleted) { |
| + throw new IllegalStateException("installation has not completed"); |
| + } |
| + return nativeGetMockUrlForData(data, dataRepeatCount); |
| + } |
| + |
| + /** |
| * Installs test files that are included in assets. |
| */ |
| private void installTestFiles() { |
| @@ -197,4 +211,7 @@ public final class MockUrlRequestJobFactory { |
| private static native String nativeGetMockUrlWithFailure(String path, |
| int phase, int netError); |
| + |
| + private static native String nativeGetMockUrlForData(String data, |
| + int dataRepeatCount); |
| } |