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

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

Issue 2283243002: Allow direct executors in cronet. (Closed)
Patch Set: Improve thread checking Created 4 years, 3 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
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.net; 5 package org.chromium.net;
6 6
7 import android.os.ConditionVariable; 7 import android.os.ConditionVariable;
8 8
9 import java.io.IOException; 9 import java.io.IOException;
10 import java.nio.ByteBuffer; 10 import java.nio.ByteBuffer;
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 272
273 @Override 273 @Override
274 public void close() throws IOException { 274 public void close() throws IOException {
275 if (!mClosed.compareAndSet(false, true)) { 275 if (!mClosed.compareAndSet(false, true)) {
276 throw new AssertionError("Closed twice"); 276 throw new AssertionError("Closed twice");
277 } 277 }
278 mAwaitingClose.open(); 278 mAwaitingClose.open();
279 } 279 }
280 280
281 public void assertClosed() { 281 public void assertClosed() {
282 mAwaitingClose.block(); 282 mAwaitingClose.block(5000);
283 if (!mClosed.get()) { 283 if (!mClosed.get()) {
284 throw new AssertionError("Was not closed"); 284 throw new AssertionError("Was not closed");
285 } 285 }
286 } 286 }
287 } 287 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698