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

Unified Diff: chrome/browser/ssl/security_state_model_browser_tests.cc

Issue 1473523002: Switch SecurityStateModel ownership to ChromeSecurityStateModelClient (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: delegate -> client Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ssl/security_state_model_android.cc ('k') | chrome/browser/ssl/ssl_browser_tests.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ssl/security_state_model_browser_tests.cc
diff --git a/chrome/browser/ssl/security_state_model_browser_tests.cc b/chrome/browser/ssl/security_state_model_browser_tests.cc
index 727dd26ababd62ae93ec05c26dbd82e5c7a401aa..db228c43e65d7399833fbba593d0f76f5f53c47f 100644
--- a/chrome/browser/ssl/security_state_model_browser_tests.cc
+++ b/chrome/browser/ssl/security_state_model_browser_tests.cc
@@ -10,6 +10,7 @@
#include "base/prefs/pref_service.h"
#include "base/strings/string_split.h"
#include "chrome/browser/ssl/cert_verifier_browser_test.h"
+#include "chrome/browser/ssl/chrome_security_state_model_client.h"
#include "chrome/browser/ssl/ssl_blocking_page.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
@@ -50,10 +51,11 @@ void CheckSecurityInfoForSecure(
bool expect_cert_error) {
ASSERT_TRUE(contents);
- SecurityStateModel* model = SecurityStateModel::FromWebContents(contents);
- ASSERT_TRUE(model);
+ ChromeSecurityStateModelClient* model_client =
+ ChromeSecurityStateModelClient::FromWebContents(contents);
+ ASSERT_TRUE(model_client);
const SecurityStateModel::SecurityInfo& security_info =
- model->GetSecurityInfo();
+ model_client->GetSecurityInfo();
EXPECT_EQ(expect_security_level, security_info.security_level);
EXPECT_EQ(expect_sha1_status, security_info.sha1_deprecation_status);
EXPECT_EQ(expect_mixed_content_status, security_info.mixed_content_status);
@@ -71,10 +73,11 @@ void CheckSecurityInfoForSecure(
void CheckSecurityInfoForNonSecure(content::WebContents* contents) {
ASSERT_TRUE(contents);
- SecurityStateModel* model = SecurityStateModel::FromWebContents(contents);
- ASSERT_TRUE(model);
+ ChromeSecurityStateModelClient* model_client =
+ ChromeSecurityStateModelClient::FromWebContents(contents);
+ ASSERT_TRUE(model_client);
const SecurityStateModel::SecurityInfo& security_info =
- model->GetSecurityInfo();
+ model_client->GetSecurityInfo();
EXPECT_EQ(SecurityStateModel::NONE, security_info.security_level);
EXPECT_EQ(SecurityStateModel::NO_DEPRECATED_SHA1,
security_info.sha1_deprecation_status);
@@ -149,10 +152,11 @@ IN_PROC_BROWSER_TEST_F(SecurityStateModelTest, HttpPage) {
browser()->tab_strip_model()->GetActiveWebContents();
ASSERT_TRUE(contents);
- SecurityStateModel* model = SecurityStateModel::FromWebContents(contents);
- ASSERT_TRUE(model);
+ ChromeSecurityStateModelClient* model_client =
+ ChromeSecurityStateModelClient::FromWebContents(contents);
+ ASSERT_TRUE(model_client);
const SecurityStateModel::SecurityInfo& security_info =
- model->GetSecurityInfo();
+ model_client->GetSecurityInfo();
EXPECT_EQ(SecurityStateModel::NONE, security_info.security_level);
EXPECT_EQ(SecurityStateModel::NO_DEPRECATED_SHA1,
security_info.sha1_deprecation_status);
@@ -482,7 +486,7 @@ IN_PROC_BROWSER_TEST_F(SecurityStateModelTest, AddedTab) {
content::WebContents* new_contents = content::WebContents::Create(
content::WebContents::CreateParams(tab->GetBrowserContext()));
content::NavigationController& controller = new_contents->GetController();
- SecurityStateModel::CreateForWebContents(new_contents);
+ ChromeSecurityStateModelClient::CreateForWebContents(new_contents);
CheckSecurityInfoForNonSecure(new_contents);
controller.LoadURL(https_server_.GetURL("/"), content::Referrer(),
ui::PAGE_TRANSITION_TYPED, std::string());
« no previous file with comments | « chrome/browser/ssl/security_state_model_android.cc ('k') | chrome/browser/ssl/ssl_browser_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698