| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/path_service.h" | 6 #include "base/path_service.h" |
| 7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "base/test/scoped_feature_list.h" | 9 #include "base/test/scoped_feature_list.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 } | 271 } |
| 272 | 272 |
| 273 // TODO(jww): This should be removed after strict secure cookies is enabled for | 273 // TODO(jww): This should be removed after strict secure cookies is enabled for |
| 274 // all and this test should be moved into ContentSettingsTest above. | 274 // all and this test should be moved into ContentSettingsTest above. |
| 275 class ContentSettingsStrictSecureCookiesBrowserTest | 275 class ContentSettingsStrictSecureCookiesBrowserTest |
| 276 : public ContentSettingsTest { | 276 : public ContentSettingsTest { |
| 277 protected: | 277 protected: |
| 278 void SetUpCommandLine(base::CommandLine* cmd) override { | 278 void SetUpCommandLine(base::CommandLine* cmd) override { |
| 279 cmd->AppendSwitch(switches::kEnableExperimentalWebPlatformFeatures); | 279 cmd->AppendSwitch(switches::kEnableExperimentalWebPlatformFeatures); |
| 280 } | 280 } |
| 281 void SetUpOnMainThread() override { |
| 282 ContentSettingsTest::SetUpOnMainThread(); |
| 283 host_resolver()->AddRule("*", "127.0.0.1"); |
| 284 } |
| 281 }; | 285 }; |
| 282 | 286 |
| 283 // This test verifies that if strict secure cookies is enabled, the site | 287 // This test verifies that if strict secure cookies is enabled, the site |
| 284 // settings accurately reflect that an attempt to create a secure cookie by an | 288 // settings accurately reflect that an attempt to create a secure cookie by an |
| 285 // insecure origin fails. | 289 // insecure origin fails. |
| 286 IN_PROC_BROWSER_TEST_F(ContentSettingsStrictSecureCookiesBrowserTest, Cookies) { | 290 IN_PROC_BROWSER_TEST_F(ContentSettingsStrictSecureCookiesBrowserTest, Cookies) { |
| 287 host_resolver()->AddRule("*", "127.0.0.1"); | |
| 288 ASSERT_TRUE(embedded_test_server()->Start()); | 291 ASSERT_TRUE(embedded_test_server()->Start()); |
| 289 | 292 |
| 290 net::EmbeddedTestServer https_server(net::EmbeddedTestServer::TYPE_HTTPS); | 293 net::EmbeddedTestServer https_server(net::EmbeddedTestServer::TYPE_HTTPS); |
| 291 https_server.ServeFilesFromSourceDirectory("chrome/test/data"); | 294 https_server.ServeFilesFromSourceDirectory("chrome/test/data"); |
| 292 ASSERT_TRUE(https_server.Start()); | 295 ASSERT_TRUE(https_server.Start()); |
| 293 | 296 |
| 294 GURL http_url = embedded_test_server()->GetURL("/setsecurecookie.html"); | 297 GURL http_url = embedded_test_server()->GetURL("/setsecurecookie.html"); |
| 295 GURL https_url = https_server.GetURL("/setsecurecookie.html"); | 298 GURL https_url = https_server.GetURL("/setsecurecookie.html"); |
| 296 | 299 |
| 297 ui_test_utils::NavigateToURL(browser(), http_url); | 300 ui_test_utils::NavigateToURL(browser(), http_url); |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 540 #endif // BUILDFLAG(ENABLE_PEPPER_CDMS) && defined(WIDEVINE_CDM_AVAILABLE) | 543 #endif // BUILDFLAG(ENABLE_PEPPER_CDMS) && defined(WIDEVINE_CDM_AVAILABLE) |
| 541 | 544 |
| 542 #if !defined(DISABLE_NACL) | 545 #if !defined(DISABLE_NACL) |
| 543 IN_PROC_BROWSER_TEST_F(PepperContentSettingsSpecialCasesJavaScriptBlockedTest, | 546 IN_PROC_BROWSER_TEST_F(PepperContentSettingsSpecialCasesJavaScriptBlockedTest, |
| 544 NaCl) { | 547 NaCl) { |
| 545 RunJavaScriptBlockedTest("load_nacl_no_js.html", true); | 548 RunJavaScriptBlockedTest("load_nacl_no_js.html", true); |
| 546 } | 549 } |
| 547 #endif // !defined(DISABLE_NACL) | 550 #endif // !defined(DISABLE_NACL) |
| 548 | 551 |
| 549 #endif // BUILDFLAG(ENABLE_PLUGINS) | 552 #endif // BUILDFLAG(ENABLE_PLUGINS) |
| OLD | NEW |