OLD | NEW |
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.net; | 5 package org.chromium.net; |
6 | 6 |
7 import java.io.IOException; | 7 import java.io.IOException; |
8 import java.nio.ByteBuffer; | 8 import java.nio.ByteBuffer; |
9 import java.util.ArrayList; | 9 import java.util.ArrayList; |
10 import java.util.concurrent.Executor; | 10 import java.util.concurrent.Executor; |
11 | 11 |
12 /** | 12 /** |
13 * An UploadDataProvider implementation used in tests. | 13 * An UploadDataProvider implementation used in tests. |
14 */ | 14 */ |
15 class TestUploadDataProvider implements UploadDataProvider { | 15 class TestUploadDataProvider extends UploadDataProvider { |
16 // Indicates whether all success callbacks are synchronous or asynchronous. | 16 // Indicates whether all success callbacks are synchronous or asynchronous. |
17 // Doesn't apply to errors. | 17 // Doesn't apply to errors. |
18 enum SuccessCallbackMode { | 18 enum SuccessCallbackMode { |
19 SYNC, | 19 SYNC, |
20 ASYNC | 20 ASYNC |
21 }; | 21 }; |
22 | 22 |
23 // Indicates whether failures should throw exceptions, invoke callbacks | 23 // Indicates whether failures should throw exceptions, invoke callbacks |
24 // synchronously, or invoke callback asynchronously. | 24 // synchronously, or invoke callback asynchronously. |
25 enum FailMode { | 25 enum FailMode { |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 "Async rewind failure")); | 235 "Async rewind failure")); |
236 } | 236 } |
237 }; | 237 }; |
238 mExecutor.execute(errorRunnable); | 238 mExecutor.execute(errorRunnable); |
239 return true; | 239 return true; |
240 default: | 240 default: |
241 return false; | 241 return false; |
242 } | 242 } |
243 } | 243 } |
244 } | 244 } |
OLD | NEW |