diff options
author | android-build-prod (mdb) <android-build-team-robot@google.com> | 2021-03-23 20:06:46 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2021-03-23 20:06:46 +0000 |
commit | bfbcc13e8aac7f0dea16cd4297a4182c875e125f (patch) | |
tree | aa248aec0c473a7dd825c25db0561131928baa0e | |
parent | 49abfa5a44d9a7a30de5b4482ce50f50d14a7c81 (diff) | |
parent | bf6137b953258faa0e1aeda42219240e323c5343 (diff) | |
download | cts-bfbcc13e8aac7f0dea16cd4297a4182c875e125f.tar.gz |
Merge "Snap for 7227589 from 0c5af4e23123eca35a182c55b764e2149ea0a32d to pie-cts-release" into pie-cts-release
5 files changed, 14 insertions, 9 deletions
diff --git a/tests/tests/security/src/android/security/cts/CertificateData.java b/tests/tests/security/src/android/security/cts/CertificateData.java index 76f86d587a2..301ba14150c 100644 --- a/tests/tests/security/src/android/security/cts/CertificateData.java +++ b/tests/tests/security/src/android/security/cts/CertificateData.java @@ -17,14 +17,12 @@ */ package android.security.cts; -import android.platform.test.annotations.SecurityTest; /** * Run "./cts/tools/utils/java-cert-list-generator.sh > * cts/tests/tests/security/src/android/security/cts/CertificateData.java" * to generate this file. */ -@SecurityTest class CertificateData { static final String[] CERTIFICATE_DATA = { "91:C6:D6:EE:3E:8A:C8:63:84:E5:48:C2:99:29:5C:75:6C:81:7B:81", diff --git a/tests/tests/security/src/android/security/cts/CertificateTest.java b/tests/tests/security/src/android/security/cts/CertificateTest.java index 2588f4db751..adc14de4689 100644 --- a/tests/tests/security/src/android/security/cts/CertificateTest.java +++ b/tests/tests/security/src/android/security/cts/CertificateTest.java @@ -20,7 +20,6 @@ import java.io.File; import java.io.FileInputStream; import java.io.IOException; import android.content.pm.PackageManager; -import android.platform.test.annotations.SecurityTest; import android.test.AndroidTestCase; import java.security.KeyStore; import java.security.KeyStoreException; @@ -37,7 +36,6 @@ import java.util.HashSet; import java.util.List; import java.util.Set; -@SecurityTest public class CertificateTest extends AndroidTestCase { // The directory for CA root certificates trusted by WFA (WiFi Alliance) static final String DIR_OF_CACERTS_FOR_WFA = "/etc/security/cacerts_wfa"; diff --git a/tests/tests/webkit/assets/webkit/page_with_link.html b/tests/tests/webkit/assets/webkit/page_with_link.html index 50fb78a4c01..4fbe86901ac 100644 --- a/tests/tests/webkit/assets/webkit/page_with_link.html +++ b/tests/tests/webkit/assets/webkit/page_with_link.html @@ -15,6 +15,8 @@ <html> <body> - <a href="http://foo.com" id="link">a link</a> + <!-- This is a relative link to an arbitrary page also hosted on this + server. --> + <a href="/assets/webkit/test_blankPage.html" id="link">a link</a> </body> </html> diff --git a/tests/tests/webkit/src/android/webkit/cts/TestHtmlConstants.java b/tests/tests/webkit/src/android/webkit/cts/TestHtmlConstants.java index ac0283c5f21..360895ae605 100644 --- a/tests/tests/webkit/src/android/webkit/cts/TestHtmlConstants.java +++ b/tests/tests/webkit/src/android/webkit/cts/TestHtmlConstants.java @@ -57,7 +57,11 @@ public class TestHtmlConstants { public static final String LOGIN_FORM_URL = "webkit/test_loginForm.html"; - public static final String EXT_WEB_URL1 = "http://www.example.com/"; + // Note: tests should avoid loading external URLs if at all possible, since any changes to that + // public site (even if it doesn't currently exist) can affect test behavior. The ".test" TLD is + // OK because (1) it's reserved for testing by RFC2606 and (2) the test never navigates to this + // page. + public static final String EXT_WEB_URL1 = "http://www.example.test/"; public static final String PARAM_ASSET_URL = "webkit/test_queryparam.html"; public static final String ANCHOR_ASSET_URL = "webkit/test_anchor.html"; @@ -66,8 +70,9 @@ public class TestHtmlConstants { public static final String DATABASE_ACCESS_URL = "webkit/test_databaseaccess.html"; public static final String STOP_LOADING_URL = "webkit/test_stop_loading.html"; public static final String BLANK_TAG_URL = "webkit/blank_tag.html"; + // A page with a link to an arbitrary page controlled by the test server (in this case, + // BLANK_PAGE_URL). public static final String PAGE_WITH_LINK_URL = "webkit/page_with_link.html"; - public static final String URL_IN_PAGE_WITH_LINK = "http://foo.com/"; // Not a real page, just triggers a 404 response. public static final String NON_EXISTENT_PAGE_URL = "webkit/generate_404.html"; public static final String BAD_IMAGE_PAGE_URL = "webkit/test_bad_image_url.html"; diff --git a/tests/tests/webkit/src/android/webkit/cts/WebViewClientTest.java b/tests/tests/webkit/src/android/webkit/cts/WebViewClientTest.java index 694593f0731..4001c7724ff 100644 --- a/tests/tests/webkit/src/android/webkit/cts/WebViewClientTest.java +++ b/tests/tests/webkit/src/android/webkit/cts/WebViewClientTest.java @@ -183,8 +183,10 @@ public class WebViewClientTest extends ActivityInstrumentationTestCase2<WebViewC } }.run(); assertEquals(mainCallCount, mainWebViewClient.getShouldOverrideUrlLoadingCallCount()); - assertEquals( - TestHtmlConstants.URL_IN_PAGE_WITH_LINK, childWebViewClient.getLastShouldOverrideUrl()); + // PAGE_WITH_LINK_URL has a link to BLANK_PAGE_URL (an arbitrary page also controlled by the + // test server) + assertEquals(mWebServer.getAssetUrl(TestHtmlConstants.BLANK_PAGE_URL), + childWebViewClient.getLastShouldOverrideUrl()); } private void clickOnLinkUsingJs(final String linkId, WebViewOnUiThread webViewOnUiThread) { |