This reverts commit eff4a85a49.
Reason for revert: Fix silent conflict and reland
Test: m && atest CtsNetHttpTestCases
Change-Id: Iff5c03189aa4fadaa94ad2c1492a9b2e41d749bc
This is a copy of the TestBidirectionalStreamCallback class
in the chromium codebase with semantic changes
Bug: 251012627
Test: th
Change-Id: I3df8970a4c0c5c1f51fcb669ff0c7d003129aa6d
New test for enable caching API. CtsTestServer doesn't add a
`cache-control: max-age=X` header, this stops Cronet HttpEngine from
caching the response. Use a non-hermetic server to circumvent that.
Test: m & test run
Change-Id: I6852c72590146892a3175ce8c23668e3abda0dbd
Currently, TestUrlRequestCallback asserts state transitions through
boolean expressions. When these fail, they simply yell "true != false",
without surfacing the wrong underlying state transition (e.g.,
`next_state == ON_REDIRECT`).
Using assertThat & matchers avoids this problem.
Test: m & test run
Change-Id: Ia26dc0e6f2fe9b53a1f92638ab0b74e39b936d3d
Assertions can terminate a test prior to that test's blockForDone call.
In this case we will try to shutdown the engine with an outstanding
request, in which case the method will throw, effectively failing the
test.
To avoid that, store a reference by the request created by the test and
always cancel it (before calling engine.shutdown()).
Also, instead of asserting the success of the requests, assume it. This
is required because these tests are not hermetic and the request might
fail due to reasons unrelated to the code being tested.
Bug: 267618889
Test: m && atest CtsNetHttpTestCasess
Change-Id: Ia1e30c99303f05342a2a73562e85d4ab2486c0d7
This was added to targets being used for coverage collection
Test: atest CtsNetHttpTestCases, NetHttpTests
Change-Id: I5e8dad82d57014cffbf7ab58b54328ea04316f70
This will allow us add more java test targets without need to change
mts-tethering-coverage. Also in tune with the current Connectivity
setup.
Will consider merging to ConnectivityCoverageTests afterwards.
Bug: 263294440
Test: atest NetHttpCoverageTests
Change-Id: I4f65b30ccf548cc7f278488d73fe9e733a9c608d
This specific test checks whether QUIC is used when it's enabled. If the
request fails the test should just be skipped to reduce flakiness (we've
another test in place for that specific case)
Bug: 267618889
Test: m && atest CtsNetHttpTestCasess
Change-Id: Ib18778c14cb4d27f079cb42948e5c3e6f35e2e92
Implement a method to echo request body as response body
Test: atest CtsNetHttpTestCases
Bug: 251012627
Change-Id: I06b8cff8a2ed98fabeb7dc6dd1c78e63e63a1489
Send multiple requests and fail if none of them was sent over QUIC.
Bug: 266661483
Test: atest CtsNetHttpTestCases
Change-Id: Idae99ccc060e243d8087f5d2ff9181f77f39f761
At the moment CronetCtsTestServer doesn't support QUIC and doesn't
report the negotiated protocol (i.e.,
UrlResponseInfo#getNegotiatedProtocol() will always return "unknown").
To circumenvent that, use "https://source.android.com" as target URL.
Test: atest CtsCronetTestCases
Change-Id: If5bf3d5e8f38675cddabba597db2d64e59cc5b60
The internet connectivity check will be required by multiple test
classes. Refactor it into a standalone utility function and port the
code to Kotlin at the same time.
Also, instead of asserting, make use of junit.Assume. This way when ther
is no internet connection the test won't fail but it will just be
reported as skipped
Test: atest CtsCronetTestCases
Change-Id: I170aa19e23a9532d84da72cbcec567b65519bb0b