OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "chrome/browser/ssl/captive_portal_blocking_page.h" | 5 #include "chrome/browser/ssl/captive_portal_blocking_page.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/base_switches.h" | 10 #include "base/base_switches.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 | 88 |
89 private: | 89 private: |
90 bool IsWifiConnection() const override { return is_wifi_; } | 90 bool IsWifiConnection() const override { return is_wifi_; } |
91 std::string GetWiFiSSID() const override { return wifi_ssid_; } | 91 std::string GetWiFiSSID() const override { return wifi_ssid_; } |
92 const bool is_wifi_; | 92 const bool is_wifi_; |
93 const std::string wifi_ssid_; | 93 const std::string wifi_ssid_; |
94 }; | 94 }; |
95 | 95 |
96 class CaptivePortalBlockingPageTest : public InProcessBrowserTest { | 96 class CaptivePortalBlockingPageTest : public InProcessBrowserTest { |
97 public: | 97 public: |
98 CaptivePortalBlockingPageTest() {} | 98 CaptivePortalBlockingPageTest() { |
| 99 CertReportHelper::SetFakeOfficialBuildForTesting(); |
| 100 } |
99 | 101 |
100 void SetUpCommandLine(base::CommandLine* command_line) override { | 102 void SetUpCommandLine(base::CommandLine* command_line) override { |
101 command_line->AppendSwitchASCII( | 103 command_line->AppendSwitchASCII( |
102 switches::kForceFieldTrials, | 104 switches::kForceFieldTrials, |
103 "ReportCertificateErrors/ShowAndPossiblySend/"); | 105 "ReportCertificateErrors/ShowAndPossiblySend/"); |
104 // Setting the sending threshold to 1.0 ensures reporting is enabled. | 106 // Setting the sending threshold to 1.0 ensures reporting is enabled. |
105 command_line->AppendSwitchASCII( | 107 command_line->AppendSwitchASCII( |
106 variations::switches::kForceFieldTrialParams, | 108 variations::switches::kForceFieldTrialParams, |
107 "ReportCertificateErrors.ShowAndPossiblySend:sendingThreshold/1.0"); | 109 "ReportCertificateErrors.ShowAndPossiblySend:sendingThreshold/1.0"); |
108 } | 110 } |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 false, ""); | 360 false, ""); |
359 return blocking_page; | 361 return blocking_page; |
360 } | 362 } |
361 }; | 363 }; |
362 | 364 |
363 // Test that an IDN login domain is decoded properly. | 365 // Test that an IDN login domain is decoded properly. |
364 IN_PROC_BROWSER_TEST_F(CaptivePortalBlockingPageIDNTest, | 366 IN_PROC_BROWSER_TEST_F(CaptivePortalBlockingPageIDNTest, |
365 ShowLoginIDNIfPortalRedirectsDetectionURL) { | 367 ShowLoginIDNIfPortalRedirectsDetectionURL) { |
366 EXPECT_TRUE(VerifyIDNDecoded()); | 368 EXPECT_TRUE(VerifyIDNDecoded()); |
367 } | 369 } |
OLD | NEW |