| Index: content/browser/shared_worker/worker_browsertest.cc
|
| diff --git a/content/browser/shared_worker/worker_browsertest.cc b/content/browser/shared_worker/worker_browsertest.cc
|
| index f991ff4e0043bf5a753f0e33dfe22983fcdd89ee..6d9e3708c15d362f6507009e28029ef5a6002693 100644
|
| --- a/content/browser/shared_worker/worker_browsertest.cc
|
| +++ b/content/browser/shared_worker/worker_browsertest.cc
|
| @@ -3,7 +3,6 @@
|
| // found in the LICENSE file.
|
|
|
| #include "base/bind.h"
|
| -#include "base/command_line.h"
|
| #include "base/files/file_path.h"
|
| #include "base/logging.h"
|
| #include "base/strings/string_util.h"
|
| @@ -14,9 +13,7 @@
|
| #include "build/build_config.h"
|
| #include "content/public/browser/browser_thread.h"
|
| #include "content/public/browser/client_certificate_delegate.h"
|
| -#include "content/public/common/content_features.h"
|
| #include "content/public/common/content_paths.h"
|
| -#include "content/public/common/content_switches.h"
|
| #include "content/public/test/browser_test_utils.h"
|
| #include "content/public/test/content_browser_test.h"
|
| #include "content/public/test/content_browser_test_utils.h"
|
| @@ -108,21 +105,6 @@
|
| int select_certificate_count_;
|
| };
|
|
|
| -class WorkerFetchTest : public testing::WithParamInterface<bool>,
|
| - public WorkerTest {
|
| - public:
|
| - ~WorkerFetchTest() override {}
|
| - void SetUpCommandLine(base::CommandLine* command_line) override {
|
| - if (GetParam()) {
|
| - command_line->AppendSwitchASCII(switches::kEnableFeatures,
|
| - features::kOffMainThreadFetch.name);
|
| - } else {
|
| - command_line->AppendSwitchASCII(switches::kDisableFeatures,
|
| - features::kOffMainThreadFetch.name);
|
| - }
|
| - }
|
| -};
|
| -
|
| IN_PROC_BROWSER_TEST_F(WorkerTest, SingleWorker) {
|
| RunTest("single_worker.html", std::string());
|
| }
|
| @@ -161,7 +143,7 @@
|
|
|
| // Make sure that auth dialog is displayed from worker context.
|
| // http://crbug.com/33344
|
| -IN_PROC_BROWSER_TEST_P(WorkerFetchTest, WorkerHttpAuth) {
|
| +IN_PROC_BROWSER_TEST_F(WorkerTest, WorkerHttpAuth) {
|
| ASSERT_TRUE(embedded_test_server()->Start());
|
| GURL url = embedded_test_server()->GetURL("/workers/worker_auth.html");
|
|
|
| @@ -175,7 +157,7 @@
|
| // but this test only tests that the delegate is called. Move handling the
|
| // WebContentsless case from chrome/ to content/ and adjust the test
|
| // accordingly.
|
| -IN_PROC_BROWSER_TEST_P(WorkerFetchTest, SharedWorkerHttpAuth) {
|
| +IN_PROC_BROWSER_TEST_F(WorkerTest, SharedWorkerHttpAuth) {
|
| if (!SupportsSharedWorker())
|
| return;
|
|
|
| @@ -184,8 +166,8 @@
|
| NavigateAndWaitForAuth(url);
|
| }
|
|
|
| -// Tests that TLS client auth prompts for normal workers's importScripts.
|
| -IN_PROC_BROWSER_TEST_P(WorkerFetchTest, WorkerTlsClientAuthImportScripts) {
|
| +// Tests that TLS client auth prompts for normal workers.
|
| +IN_PROC_BROWSER_TEST_F(WorkerTest, WorkerTlsClientAuth) {
|
| // Launch HTTPS server.
|
| net::EmbeddedTestServer https_server(net::EmbeddedTestServer::TYPE_HTTPS);
|
| https_server.ServeFilesFromSourceDirectory("content/test/data");
|
| @@ -196,13 +178,17 @@
|
| ASSERT_TRUE(https_server.Start());
|
|
|
| RunTest("worker_tls_client_auth.html",
|
| - "test=import&url=" + net::EscapeQueryParamValue(
|
| - https_server.GetURL("/").spec(), true));
|
| + "url=" + net::EscapeQueryParamValue(https_server.GetURL("/").spec(),
|
| + true));
|
| EXPECT_EQ(1, select_certificate_count());
|
| }
|
|
|
| -// Tests that TLS client auth prompts for normal workers's fetch() call.
|
| -IN_PROC_BROWSER_TEST_P(WorkerFetchTest, WorkerTlsClientAuthFetch) {
|
| +// Tests that TLS client auth does not prompt for a shared worker; shared
|
| +// workers are not associated with a WebContents.
|
| +IN_PROC_BROWSER_TEST_F(WorkerTest, SharedWorkerTlsClientAuth) {
|
| + if (!SupportsSharedWorker())
|
| + return;
|
| +
|
| // Launch HTTPS server.
|
| net::EmbeddedTestServer https_server(net::EmbeddedTestServer::TYPE_HTTPS);
|
| https_server.ServeFilesFromSourceDirectory("content/test/data");
|
| @@ -213,31 +199,8 @@
|
| ASSERT_TRUE(https_server.Start());
|
|
|
| RunTest("worker_tls_client_auth.html",
|
| - "test=fetch&url=" + net::EscapeQueryParamValue(
|
| - https_server.GetURL("/").spec(), true));
|
| - EXPECT_EQ(1, select_certificate_count());
|
| -}
|
| -
|
| -// Tests that TLS client auth does not prompt for a shared worker; shared
|
| -// workers are not associated with a WebContents.
|
| -IN_PROC_BROWSER_TEST_P(WorkerFetchTest,
|
| - SharedWorkerTlsClientAuthImportScripts) {
|
| - if (!SupportsSharedWorker())
|
| - return;
|
| -
|
| - // Launch HTTPS server.
|
| - net::EmbeddedTestServer https_server(net::EmbeddedTestServer::TYPE_HTTPS);
|
| - https_server.ServeFilesFromSourceDirectory("content/test/data");
|
| - net::SSLServerConfig ssl_config;
|
| - ssl_config.client_cert_type =
|
| - net::SSLServerConfig::ClientCertType::REQUIRE_CLIENT_CERT;
|
| - https_server.SetSSLConfig(net::EmbeddedTestServer::CERT_OK, ssl_config);
|
| - ASSERT_TRUE(https_server.Start());
|
| -
|
| - RunTest(
|
| - "worker_tls_client_auth.html",
|
| - "test=import&shared=true&url=" +
|
| - net::EscapeQueryParamValue(https_server.GetURL("/").spec(), true));
|
| + "shared=true&url=" + net::EscapeQueryParamValue(
|
| + https_server.GetURL("/").spec(), true));
|
| EXPECT_EQ(0, select_certificate_count());
|
| }
|
|
|
| @@ -281,8 +244,4 @@
|
| RunTest("pass_messageport_to_sharedworker_dont_wait_for_connect.html", "");
|
| }
|
|
|
| -INSTANTIATE_TEST_CASE_P(/* no prefix */,
|
| - WorkerFetchTest,
|
| - ::testing::Values(true, false));
|
| -
|
| } // namespace content
|
|
|