Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 350 ~SecurityStyleTestObserver() override {} | 350 ~SecurityStyleTestObserver() override {} |
| 351 | 351 |
| 352 void SecurityStyleChanged(content::SecurityStyle security_style) override { | 352 void SecurityStyleChanged(content::SecurityStyle security_style) override { |
| 353 latest_security_style_ = security_style; | 353 latest_security_style_ = security_style; |
| 354 } | 354 } |
| 355 | 355 |
| 356 content::SecurityStyle latest_security_style() const { | 356 content::SecurityStyle latest_security_style() const { |
| 357 return latest_security_style_; | 357 return latest_security_style_; |
| 358 } | 358 } |
| 359 | 359 |
| 360 void ClearLatestSecurityStyle() { | |
| 361 latest_security_style_ = content::SECURITY_STYLE_UNKNOWN; | |
| 362 } | |
| 363 | |
| 360 private: | 364 private: |
| 361 content::SecurityStyle latest_security_style_; | 365 content::SecurityStyle latest_security_style_; |
| 362 | 366 |
| 363 DISALLOW_COPY_AND_ASSIGN(SecurityStyleTestObserver); | 367 DISALLOW_COPY_AND_ASSIGN(SecurityStyleTestObserver); |
| 364 }; | 368 }; |
| 365 | 369 |
| 366 } // namespace | 370 } // namespace |
| 367 | 371 |
| 368 class BrowserTest : public ExtensionBrowserTest { | 372 class BrowserTest : public ExtensionBrowserTest { |
| 369 protected: | 373 protected: |
| (...skipping 2487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2857 GURL mixed_content_url(https_test_server.GetURL(replacement_path)); | 2861 GURL mixed_content_url(https_test_server.GetURL(replacement_path)); |
| 2858 ui_test_utils::NavigateToURL(browser(), mixed_content_url); | 2862 ui_test_utils::NavigateToURL(browser(), mixed_content_url); |
| 2859 EXPECT_EQ(content::SECURITY_STYLE_WARNING, observer.latest_security_style()); | 2863 EXPECT_EQ(content::SECURITY_STYLE_WARNING, observer.latest_security_style()); |
| 2860 | 2864 |
| 2861 // Visit a broken HTTPS url. Other conditions cannot be tested after | 2865 // Visit a broken HTTPS url. Other conditions cannot be tested after |
| 2862 // this one because once the interstitial is clicked through, all URLs | 2866 // this one because once the interstitial is clicked through, all URLs |
| 2863 // for this host will remain in a broken state. | 2867 // for this host will remain in a broken state. |
| 2864 GURL expired_url(https_test_server_expired.GetURL(std::string())); | 2868 GURL expired_url(https_test_server_expired.GetURL(std::string())); |
| 2865 ui_test_utils::NavigateToURL(browser(), expired_url); | 2869 ui_test_utils::NavigateToURL(browser(), expired_url); |
| 2866 | 2870 |
| 2871 EXPECT_EQ(content::SECURITY_STYLE_AUTHENTICATION_BROKEN, | |
|
nasko
2015/06/25 12:59:32
We expect to have an interstitial page being displ
estark
2015/06/25 14:54:44
Done.
| |
| 2872 observer.latest_security_style()); | |
| 2873 | |
| 2874 observer.ClearLatestSecurityStyle(); | |
| 2875 | |
| 2867 ProceedThroughInterstitial(web_contents); | 2876 ProceedThroughInterstitial(web_contents); |
| 2877 | |
|
nasko
2015/06/25 12:59:32
nit: Why the extra empty line here?
estark
2015/06/25 14:54:44
Done.
| |
| 2868 EXPECT_EQ(content::SECURITY_STYLE_AUTHENTICATION_BROKEN, | 2878 EXPECT_EQ(content::SECURITY_STYLE_AUTHENTICATION_BROKEN, |
| 2869 observer.latest_security_style()); | 2879 observer.latest_security_style()); |
|
nasko
2015/06/25 12:59:32
Do we have a test that ensures that if the user ty
estark
2015/06/25 14:54:44
Going back (as in "clicking the back button") does
nasko
2015/06/26 08:53:04
I meant this one indeed. Thanks for adding it!
| |
| 2870 } | 2880 } |
| OLD | NEW |