Revert "Cronet: add test server"
This reverts commit a0f25c4ed0.
Reason for revert: breaking in postsubmit. See b/262291156
Change-Id: I1ba3bcc5e25b384b18112371e4835ba25c40ad44
This commit is contained in:
@@ -20,14 +20,10 @@ package {
|
||||
|
||||
java_library {
|
||||
name: "CronetApiCommonTests",
|
||||
srcs: [
|
||||
"src/**/*.java",
|
||||
"src/**/*.kt"
|
||||
],
|
||||
srcs: ["src/**/*.java"],
|
||||
static_libs: [
|
||||
"androidx.test.rules",
|
||||
"androidx.core_core",
|
||||
"ctstestserver",
|
||||
"junit",
|
||||
],
|
||||
libs: [
|
||||
@@ -36,7 +32,6 @@ java_library {
|
||||
"android.test.mock",
|
||||
"androidx.annotation_annotation",
|
||||
"framework-cronet",
|
||||
"org.apache.http.legacy",
|
||||
],
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
|
||||
<application android:networkSecurityConfig="@xml/network_security_config">
|
||||
<application>
|
||||
<uses-library android:name="android.test.runner" />
|
||||
<uses-library android:name="framework-cronet" />
|
||||
</application>
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
<!--
|
||||
~ Copyright (C) 2022 The Android Open Source Project
|
||||
~
|
||||
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||
~ you may not use this file except in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing, software
|
||||
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
~ See the License for the specific language governing permissions and
|
||||
~ limitations under the License.
|
||||
-->
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>hello world</title>
|
||||
</head>
|
||||
<body>
|
||||
<h3>hello world</h3><br>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,23 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!--
|
||||
~ Copyright (C) 2022 The Android Open Source Project
|
||||
~
|
||||
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||
~ you may not use this file except in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing, software
|
||||
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
~ See the License for the specific language governing permissions and
|
||||
~ limitations under the License.
|
||||
-->
|
||||
|
||||
<network-security-config>
|
||||
<domain-config cleartextTrafficPermitted="true">
|
||||
<domain includeSubdomains="true">localhost</domain>
|
||||
</domain-config>
|
||||
</network-security-config>
|
||||
@@ -29,7 +29,6 @@ import androidx.test.runner.AndroidJUnit4;
|
||||
import org.chromium.net.CronetEngine;
|
||||
import org.chromium.net.UrlRequest;
|
||||
import org.chromium.net.UrlResponseInfo;
|
||||
import org.chromium.net.test.util.CronetCtsTestServer;
|
||||
import org.chromium.net.test.util.TestUrlRequestCallback;
|
||||
import org.chromium.net.test.util.TestUrlRequestCallback.ResponseStep;
|
||||
import org.junit.Before;
|
||||
@@ -46,7 +45,6 @@ public class CronetUrlRequestTest {
|
||||
private final String[] mTestDomains = {"www.google.com", "www.android.com"};
|
||||
@NonNull private CronetEngine mCronetEngine;
|
||||
@NonNull private ConnectivityManager mCm;
|
||||
@NonNull private CronetCtsTestServer mTestServer;
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
@@ -58,7 +56,6 @@ public class CronetUrlRequestTest {
|
||||
// .enableBrotli(true)
|
||||
.enableQuic(true);
|
||||
mCronetEngine = builder.build();
|
||||
mTestServer = new CronetCtsTestServer(context);
|
||||
}
|
||||
|
||||
private static void assertGreaterThan(String msg, int first, int second) {
|
||||
@@ -77,7 +74,7 @@ public class CronetUrlRequestTest {
|
||||
@Test
|
||||
public void testUrlRequestGet_CompletesSuccessfully() throws Exception {
|
||||
assertHasTestableNetworks();
|
||||
String url = mTestServer.getSuccessUrl();
|
||||
String url = HTTPS_PREFIX + getRandomDomain();
|
||||
TestUrlRequestCallback callback = new TestUrlRequestCallback();
|
||||
UrlRequest.Builder builder = mCronetEngine.newUrlRequestBuilder(url, callback,
|
||||
callback.getExecutor());
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2022 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.chromium.net.test.util
|
||||
|
||||
import android.content.Context
|
||||
import android.webkit.cts.CtsTestServer
|
||||
|
||||
/** Extends CtsTestServer to handle POST requests and other cronet specific test requests */
|
||||
class CronetCtsTestServer(context: Context) : CtsTestServer(context) {
|
||||
|
||||
val successUrl: String = getAssetUrl("html/hello_world.html")
|
||||
}
|
||||
Reference in New Issue
Block a user