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

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

Issue 1773613002: Mark some cronet instrumentation tests flaky. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 | « components/cronet/android/test/javatests/src/org/chromium/net/CronetUrlRequestContextTest.java ('k') | 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.ConditionVariable; 7 import android.os.ConditionVariable;
8 import android.test.FlakyTest;
8 import android.test.MoreAsserts; 9 import android.test.MoreAsserts;
9 import android.test.suitebuilder.annotation.SmallTest; 10 import android.test.suitebuilder.annotation.SmallTest;
10 import android.util.Log; 11 import android.util.Log;
11 12
12 import org.chromium.base.test.util.Feature; 13 import org.chromium.base.test.util.Feature;
13 import org.chromium.net.TestUrlRequestCallback.FailureType; 14 import org.chromium.net.TestUrlRequestCallback.FailureType;
14 import org.chromium.net.TestUrlRequestCallback.ResponseStep; 15 import org.chromium.net.TestUrlRequestCallback.ResponseStep;
15 import org.chromium.net.test.FailurePhase; 16 import org.chromium.net.test.FailurePhase;
16 17
17 import java.net.ConnectException; 18 import java.net.ConnectException;
(...skipping 1423 matching lines...) Expand 10 before | Expand all | Expand 10 after
1441 assertTrue(urlRequest.isDone()); 1442 assertTrue(urlRequest.isDone());
1442 assertEquals(expectResponseInfo, callback.mResponseInfo != null); 1443 assertEquals(expectResponseInfo, callback.mResponseInfo != null);
1443 assertEquals(expectError, callback.mError != null); 1444 assertEquals(expectError, callback.mError != null);
1444 assertEquals(expectError, callback.mOnErrorCalled); 1445 assertEquals(expectError, callback.mOnErrorCalled);
1445 assertEquals(failureType == FailureType.CANCEL_SYNC 1446 assertEquals(failureType == FailureType.CANCEL_SYNC
1446 || failureType == FailureType.CANCEL_ASYNC 1447 || failureType == FailureType.CANCEL_ASYNC
1447 || failureType == FailureType.CANCEL_ASYNC_WITHOUT_PAUSE , 1448 || failureType == FailureType.CANCEL_ASYNC_WITHOUT_PAUSE ,
1448 callback.mOnCanceledCalled); 1449 callback.mOnCanceledCalled);
1449 } 1450 }
1450 1451
1452 /*
1451 @SmallTest 1453 @SmallTest
1452 @Feature({"Cronet"}) 1454 @Feature({"Cronet"})
1455 https://crbug.com/592444
1456 */
1457 @FlakyTest
1453 public void testFailures() throws Exception { 1458 public void testFailures() throws Exception {
1454 throwOrCancel(FailureType.CANCEL_SYNC, ResponseStep.ON_RECEIVED_REDIRECT , 1459 throwOrCancel(FailureType.CANCEL_SYNC, ResponseStep.ON_RECEIVED_REDIRECT ,
1455 false, false); 1460 false, false);
1456 throwOrCancel(FailureType.CANCEL_ASYNC, ResponseStep.ON_RECEIVED_REDIREC T, 1461 throwOrCancel(FailureType.CANCEL_ASYNC, ResponseStep.ON_RECEIVED_REDIREC T,
1457 false, false); 1462 false, false);
1458 throwOrCancel(FailureType.CANCEL_ASYNC_WITHOUT_PAUSE, ResponseStep.ON_RE CEIVED_REDIRECT, 1463 throwOrCancel(FailureType.CANCEL_ASYNC_WITHOUT_PAUSE, ResponseStep.ON_RE CEIVED_REDIRECT,
1459 false, false); 1464 false, false);
1460 throwOrCancel(FailureType.THROW_SYNC, ResponseStep.ON_RECEIVED_REDIRECT, 1465 throwOrCancel(FailureType.THROW_SYNC, ResponseStep.ON_RECEIVED_REDIRECT,
1461 false, true); 1466 false, true);
1462 1467
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
1672 private String bufferContentsToString(ByteBuffer byteBuffer, int start, int end) { 1677 private String bufferContentsToString(ByteBuffer byteBuffer, int start, int end) {
1673 // Use a duplicate to avoid modifying byteBuffer. 1678 // Use a duplicate to avoid modifying byteBuffer.
1674 ByteBuffer duplicate = byteBuffer.duplicate(); 1679 ByteBuffer duplicate = byteBuffer.duplicate();
1675 duplicate.position(start); 1680 duplicate.position(start);
1676 duplicate.limit(end); 1681 duplicate.limit(end);
1677 byte[] contents = new byte[duplicate.remaining()]; 1682 byte[] contents = new byte[duplicate.remaining()];
1678 duplicate.get(contents); 1683 duplicate.get(contents);
1679 return new String(contents); 1684 return new String(contents);
1680 } 1685 }
1681 } 1686 }
OLDNEW
« no previous file with comments | « components/cronet/android/test/javatests/src/org/chromium/net/CronetUrlRequestContextTest.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698