New issue
Advanced search Search tips

Issue 637972 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner: ----
Closed: Oct 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

Many tests are not tested with JavaCronetEngine

Project Member Reported by kapishnikov@chromium.org, Aug 15 2016

Issue description

There are many tests that are not annotated with @OnlyRunNativeCronet and are supposed to run both with the native Cronet and Java implementations. However, they are run twice with the Cronet implementation instead.

The solution that is implemented inside CronetTestBase.java works only if CronetTestFramework is instantiated in the test SetUp() method. Instantiating CronetTestFramework directly inside the tests leads to double execution of the Cronet native implementation. CronetTestBase#runTest() is supposed to substitute the native Cronet implementation with Java implementation between the two test runs by assigning JavaCronetEngine implementation to CronetTestFramework.mCronetEngine field. This substitution does not work if a test is calling one of startCronetTestFrameworkXXX() methods.

There are YY calls from tests that are not annotated with @OnlyRunNativeCronet:
17 calls to startCronetTestFramework() 
5 calls to startCronetTestFrameworkWithUrlAndCronetEngineBuilder()
4 calls to startCronetTestFrameworkWithUrlAndCommandLineArgs()
12 calls to startCronetTestFrameworkAndSkipLibraryInit()
6 calls to startCronetTestFrameworkForLegacyApi()
 
Labels: OS-Android
Should we investigate whether we can switch to ParameterizedTest ?https://cs.chromium.org/chromium/src/base/test/android/javatests/src/org/chromium/base/test/util/parameter/ParameterizedTest.java

It seems a lot of tests will be clearer that way.
Status: Available (was: Untriaged)
Labels: Hotlist-Fixit
Related  Issue 669264 . Having two test APKs can help in solving of this issue. The CronetTestBase class could be simplified. This would also guarantee that setUp() & tearDown() is called for every test.
Labels: -Pri-2 Pri-3
During the junit4 conversion I changed the way the native/java impls are tested.  With junit4 the setUp() and tearDown() functions are called twice, but more relevant is that I made CronetTestCommon.startCronetTestFramework() decide whether to return a native or java impl depending on testingJavaImpl(), not defaulting to the native one like before.
Status: Fixed (was: Available)
Since Paul fixed it, we can close the issue.

Sign in to add a comment