| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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.support.test.filters.SmallTest; | 7 import android.support.test.filters.SmallTest; |
| 8 | 8 |
| 9 import org.chromium.base.test.util.Feature; | 9 import org.chromium.base.test.util.Feature; |
| 10 import org.chromium.net.impl.CronetUrlRequestContext; | 10 import org.chromium.net.impl.CronetUrlRequestContext; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 */ | 21 */ |
| 22 private boolean mTestWasRun; | 22 private boolean mTestWasRun; |
| 23 /** | 23 /** |
| 24 * For {@link #testRunBothImplsMustRun}, use {@link #mTestNativeImplRun} to
verify that the | 24 * For {@link #testRunBothImplsMustRun}, use {@link #mTestNativeImplRun} to
verify that the |
| 25 * test is run against the native implementation. | 25 * test is run against the native implementation. |
| 26 */ | 26 */ |
| 27 private boolean mTestNativeImplRun; | 27 private boolean mTestNativeImplRun; |
| 28 | 28 |
| 29 @Override | 29 @Override |
| 30 protected void setUp() throws Exception { | 30 protected void setUp() throws Exception { |
| 31 super.setUp(); |
| 31 mTestFramework = startCronetTestFramework(); | 32 mTestFramework = startCronetTestFramework(); |
| 32 } | 33 } |
| 33 | 34 |
| 34 @Override | 35 @Override |
| 35 protected void tearDown() throws Exception { | 36 protected void tearDown() throws Exception { |
| 36 if (getName().contains("MustRun") && !mTestWasRun) { | 37 if (getName().contains("MustRun") && !mTestWasRun) { |
| 37 fail(getName() + " should have run but didn't."); | 38 fail(getName() + " should have run but didn't."); |
| 38 } | 39 } |
| 39 super.tearDown(); | 40 super.tearDown(); |
| 40 } | 41 } |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 @SmallTest | 73 @SmallTest |
| 73 @Feature({"Cronet"}) | 74 @Feature({"Cronet"}) |
| 74 @OnlyRunNativeCronet | 75 @OnlyRunNativeCronet |
| 75 public void testRunOnlyNativeMustRun() { | 76 public void testRunOnlyNativeMustRun() { |
| 76 assertFalse(testingJavaImpl()); | 77 assertFalse(testingJavaImpl()); |
| 77 assertFalse(mTestWasRun); | 78 assertFalse(mTestWasRun); |
| 78 mTestWasRun = true; | 79 mTestWasRun = true; |
| 79 assertEquals(mTestFramework.mCronetEngine.getClass(), CronetUrlRequestCo
ntext.class); | 80 assertEquals(mTestFramework.mCronetEngine.getClass(), CronetUrlRequestCo
ntext.class); |
| 80 } | 81 } |
| 81 } | 82 } |
| OLD | NEW |