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

Side by Side Diff: chrome/browser/io_thread_unittest.cc

Issue 2753123002: Add --ignore-certificate-errors-spki-list switch and UMA histogram. (Closed)
Patch Set: Created 3 years, 9 months 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include "base/at_exit.h" 7 #include "base/at_exit.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 450
451 TEST_F(ConfigureParamsFromFieldTrialsAndCommandLineTest, 451 TEST_F(ConfigureParamsFromFieldTrialsAndCommandLineTest,
452 IgnoreCertificateErrors) { 452 IgnoreCertificateErrors) {
453 command_line_.AppendSwitch("ignore-certificate-errors"); 453 command_line_.AppendSwitch("ignore-certificate-errors");
454 454
455 ConfigureParamsFromFieldTrialsAndCommandLine(); 455 ConfigureParamsFromFieldTrialsAndCommandLine();
456 456
457 EXPECT_TRUE(params_.ignore_certificate_errors); 457 EXPECT_TRUE(params_.ignore_certificate_errors);
458 } 458 }
459 459
460 TEST_F(ConfigureParamsFromFieldTrialsAndCommandLineTest,
461 DisableCertificateErrorsSPKIList) {
462 command_line_.AppendSwitchASCII(
463 "disable-certificate-errors-spki-list",
464 "foo,BZef6CjpE0HUDfp5ra3F3soQ9kkFxZoBo5PiK1hpudI=");
465
466 ConfigureParamsFromFieldTrialsAndCommandLine();
467
468 EXPECT_EQ(2u, params_.ignore_certificate_error_spki_list.size());
469 EXPECT_TRUE(
470 base::ContainsKey(params_.ignore_certificate_error_spki_list, "foo"));
471 EXPECT_TRUE(
472 base::ContainsKey(params_.ignore_certificate_error_spki_list,
473 "BZef6CjpE0HUDfp5ra3F3soQ9kkFxZoBo5PiK1hpudI="));
474 }
475
460 TEST_F(ConfigureParamsFromFieldTrialsAndCommandLineTest, TestingFixedPort) { 476 TEST_F(ConfigureParamsFromFieldTrialsAndCommandLineTest, TestingFixedPort) {
461 command_line_.AppendSwitchASCII("testing-fixed-http-port", "42"); 477 command_line_.AppendSwitchASCII("testing-fixed-http-port", "42");
462 command_line_.AppendSwitchASCII("testing-fixed-https-port", "137"); 478 command_line_.AppendSwitchASCII("testing-fixed-https-port", "137");
463 479
464 ConfigureParamsFromFieldTrialsAndCommandLine(); 480 ConfigureParamsFromFieldTrialsAndCommandLine();
465 481
466 EXPECT_EQ(42u, params_.testing_fixed_http_port); 482 EXPECT_EQ(42u, params_.testing_fixed_http_port);
467 EXPECT_EQ(137u, params_.testing_fixed_https_port); 483 EXPECT_EQ(137u, params_.testing_fixed_https_port);
468 } 484 }
469 485
470 } // namespace test 486 } // namespace test
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698