Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(301)

Side by Side Diff: chrome/browser/ssl/ssl_browser_tests.cc

Issue 816403003: Make callers of CommandLine use it via the base:: namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/bind.h" 5 #include "base/bind.h"
6 #include "base/bind_helpers.h" 6 #include "base/bind_helpers.h"
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 https_server_expired_(net::SpawnedTestServer::TYPE_HTTPS, 179 https_server_expired_(net::SpawnedTestServer::TYPE_HTTPS,
180 SSLOptions(SSLOptions::CERT_EXPIRED), 180 SSLOptions(SSLOptions::CERT_EXPIRED),
181 base::FilePath(kDocRoot)), 181 base::FilePath(kDocRoot)),
182 https_server_mismatched_(net::SpawnedTestServer::TYPE_HTTPS, 182 https_server_mismatched_(net::SpawnedTestServer::TYPE_HTTPS,
183 SSLOptions(SSLOptions::CERT_MISMATCHED_NAME), 183 SSLOptions(SSLOptions::CERT_MISMATCHED_NAME),
184 base::FilePath(kDocRoot)), 184 base::FilePath(kDocRoot)),
185 wss_server_expired_(net::SpawnedTestServer::TYPE_WSS, 185 wss_server_expired_(net::SpawnedTestServer::TYPE_WSS,
186 SSLOptions(SSLOptions::CERT_EXPIRED), 186 SSLOptions(SSLOptions::CERT_EXPIRED),
187 net::GetWebSocketTestDataDirectory()) {} 187 net::GetWebSocketTestDataDirectory()) {}
188 188
189 void SetUpCommandLine(CommandLine* command_line) override { 189 void SetUpCommandLine(base::CommandLine* command_line) override {
190 // Browser will both run and display insecure content. 190 // Browser will both run and display insecure content.
191 command_line->AppendSwitch(switches::kAllowRunningInsecureContent); 191 command_line->AppendSwitch(switches::kAllowRunningInsecureContent);
192 // Use process-per-site so that navigating to a same-site page in a 192 // Use process-per-site so that navigating to a same-site page in a
193 // new tab will use the same process. 193 // new tab will use the same process.
194 command_line->AppendSwitch(switches::kProcessPerSite); 194 command_line->AppendSwitch(switches::kProcessPerSite);
195 } 195 }
196 196
197 void CheckAuthenticatedState(WebContents* tab, 197 void CheckAuthenticatedState(WebContents* tab,
198 int expected_authentication_state) { 198 int expected_authentication_state) {
199 CheckSecurityState(tab, 199 CheckSecurityState(tab,
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 typedef net::SpawnedTestServer::SSLOptions SSLOptions; 357 typedef net::SpawnedTestServer::SSLOptions SSLOptions;
358 358
359 DISALLOW_COPY_AND_ASSIGN(SSLUITest); 359 DISALLOW_COPY_AND_ASSIGN(SSLUITest);
360 }; 360 };
361 361
362 class SSLUITestBlock : public SSLUITest { 362 class SSLUITestBlock : public SSLUITest {
363 public: 363 public:
364 SSLUITestBlock() : SSLUITest() {} 364 SSLUITestBlock() : SSLUITest() {}
365 365
366 // Browser will neither run nor display insecure content. 366 // Browser will neither run nor display insecure content.
367 void SetUpCommandLine(CommandLine* command_line) override { 367 void SetUpCommandLine(base::CommandLine* command_line) override {
368 command_line->AppendSwitch(switches::kNoDisplayingInsecureContent); 368 command_line->AppendSwitch(switches::kNoDisplayingInsecureContent);
369 } 369 }
370 }; 370 };
371 371
372 class SSLUITestIgnoreCertErrors : public SSLUITest { 372 class SSLUITestIgnoreCertErrors : public SSLUITest {
373 public: 373 public:
374 SSLUITestIgnoreCertErrors() : SSLUITest() {} 374 SSLUITestIgnoreCertErrors() : SSLUITest() {}
375 375
376 void SetUpCommandLine(CommandLine* command_line) override { 376 void SetUpCommandLine(base::CommandLine* command_line) override {
377 // Browser will ignore certificate errors. 377 // Browser will ignore certificate errors.
378 command_line->AppendSwitch(switches::kIgnoreCertificateErrors); 378 command_line->AppendSwitch(switches::kIgnoreCertificateErrors);
379 } 379 }
380 }; 380 };
381 381
382 // Visits a regular page over http. 382 // Visits a regular page over http.
383 IN_PROC_BROWSER_TEST_F(SSLUITest, TestHTTP) { 383 IN_PROC_BROWSER_TEST_F(SSLUITest, TestHTTP) {
384 ASSERT_TRUE(test_server()->Start()); 384 ASSERT_TRUE(test_server()->Start());
385 385
386 ui_test_utils::NavigateToURL(browser(), 386 ui_test_utils::NavigateToURL(browser(),
(...skipping 1492 matching lines...) Expand 10 before | Expand all | Expand 10 after
1879 1879
1880 // Visit a page over https that contains a frame with a redirect. 1880 // Visit a page over https that contains a frame with a redirect.
1881 1881
1882 // XMLHttpRequest insecure content in synchronous mode. 1882 // XMLHttpRequest insecure content in synchronous mode.
1883 1883
1884 // XMLHttpRequest insecure content in asynchronous mode. 1884 // XMLHttpRequest insecure content in asynchronous mode.
1885 1885
1886 // XMLHttpRequest over bad ssl in synchronous mode. 1886 // XMLHttpRequest over bad ssl in synchronous mode.
1887 1887
1888 // XMLHttpRequest over OK ssl in synchronous mode. 1888 // XMLHttpRequest over OK ssl in synchronous mode.
OLDNEW
« no previous file with comments | « chrome/browser/ssl/ssl_blocking_page.cc ('k') | chrome/browser/supervised_user/permission_request_creator_apiary.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698