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

Unified Diff: chrome/browser/cocoa/page_info_window_mac_unittest.mm

Issue 3560004: Refactor the code for loading icons into the PageInfoModel. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: cleanup Created 10 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/cocoa/page_info_window_mac.mm ('k') | chrome/browser/gtk/page_info_bubble_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/page_info_window_mac_unittest.mm
diff --git a/chrome/browser/cocoa/page_info_window_mac_unittest.mm b/chrome/browser/cocoa/page_info_window_mac_unittest.mm
index 632aac1a5075ae6044223e246c9b529e1a9abbf3..7ef5908fd2a81d9c1d889c432944f82595ab8f03 100644
--- a/chrome/browser/cocoa/page_info_window_mac_unittest.mm
+++ b/chrome/browser/cocoa/page_info_window_mac_unittest.mm
@@ -19,12 +19,14 @@ namespace {
class FakeModel : public PageInfoModel {
public:
- void AddSection(SectionInfoState state,
+ FakeModel() : PageInfoModel() {}
+
+ void AddSection(SectionStateIcon icon_id,
const string16& title,
const string16& description,
SectionInfoType type) {
sections_.push_back(SectionInfo(
- state,
+ icon_id,
title,
string16(),
description,
@@ -89,8 +91,7 @@ class PageInfoWindowMacTest : public CocoaTest {
for (NSView* view in subviews) {
if ([view isKindOfClass:[NSImageView class]]) {
NSImageView* image_view = static_cast<NSImageView*>(view);
- EXPECT_TRUE([image_view image] == bridge_->good_image_.get() ||
- [image_view image] == bridge_->bad_image_.get());
+ EXPECT_TRUE([image_view image]);
} else if ([view isKindOfClass:[NSTextField class]]) {
NSTextField* text_field = static_cast<NSTextField*>(view);
EXPECT_LT(0U, [[text_field stringValue] length]);
@@ -111,13 +112,13 @@ class PageInfoWindowMacTest : public CocoaTest {
TEST_F(PageInfoWindowMacTest, NoHistoryNoSecurity) {
- model_->AddSection(PageInfoModel::SECTION_STATE_ERROR,
+ model_->AddSection(PageInfoModel::ICON_STATE_ERROR,
l10n_util::GetStringUTF16(IDS_PAGE_INFO_SECURITY_TAB_IDENTITY_TITLE),
l10n_util::GetStringFUTF16(
IDS_PAGE_INFO_SECURITY_TAB_UNKNOWN_PARTY,
ASCIIToUTF16("google.com")),
PageInfoModel::SECTION_INFO_IDENTITY);
- model_->AddSection(PageInfoModel::SECTION_STATE_ERROR,
+ model_->AddSection(PageInfoModel::ICON_STATE_ERROR,
l10n_util::GetStringUTF16(IDS_PAGE_INFO_SECURITY_TAB_CONNECTION_TITLE),
l10n_util::GetStringFUTF16(
IDS_PAGE_INFO_SECURITY_TAB_NOT_ENCRYPTED_CONNECTION_TEXT,
@@ -131,13 +132,13 @@ TEST_F(PageInfoWindowMacTest, NoHistoryNoSecurity) {
TEST_F(PageInfoWindowMacTest, HistoryNoSecurity) {
- model_->AddSection(PageInfoModel::SECTION_STATE_ERROR,
+ model_->AddSection(PageInfoModel::ICON_STATE_ERROR,
l10n_util::GetStringUTF16(IDS_PAGE_INFO_SECURITY_TAB_IDENTITY_TITLE),
l10n_util::GetStringFUTF16(
IDS_PAGE_INFO_SECURITY_TAB_UNKNOWN_PARTY,
ASCIIToUTF16("google.com")),
PageInfoModel::SECTION_INFO_IDENTITY);
- model_->AddSection(PageInfoModel::SECTION_STATE_ERROR,
+ model_->AddSection(PageInfoModel::ICON_STATE_ERROR,
l10n_util::GetStringUTF16(IDS_PAGE_INFO_SECURITY_TAB_CONNECTION_TITLE),
l10n_util::GetStringFUTF16(
IDS_PAGE_INFO_SECURITY_TAB_NOT_ENCRYPTED_CONNECTION_TEXT,
@@ -148,7 +149,7 @@ TEST_F(PageInfoWindowMacTest, HistoryNoSecurity) {
// asynchronously, so replicate the double-build here.
bridge_->ModelChanged();
- model_->AddSection(PageInfoModel::SECTION_STATE_ERROR,
+ model_->AddSection(PageInfoModel::ICON_STATE_ERROR,
l10n_util::GetStringUTF16(
IDS_PAGE_INFO_SECURITY_TAB_PERSONAL_HISTORY_TITLE),
l10n_util::GetStringUTF16(
@@ -162,7 +163,7 @@ TEST_F(PageInfoWindowMacTest, HistoryNoSecurity) {
TEST_F(PageInfoWindowMacTest, NoHistoryMixedSecurity) {
- model_->AddSection(PageInfoModel::SECTION_STATE_OK,
+ model_->AddSection(PageInfoModel::ICON_STATE_OK,
l10n_util::GetStringUTF16(IDS_PAGE_INFO_SECURITY_TAB_IDENTITY_TITLE),
l10n_util::GetStringFUTF16(
IDS_PAGE_INFO_SECURITY_TAB_SECURE_IDENTITY,
@@ -173,7 +174,7 @@ TEST_F(PageInfoWindowMacTest, NoHistoryMixedSecurity) {
// region (kImageSize).
string16 title =
l10n_util::GetStringUTF16(IDS_PAGE_INFO_SECURITY_TAB_CONNECTION_TITLE);
- model_->AddSection(PageInfoModel::SECTION_STATE_OK,
+ model_->AddSection(PageInfoModel::ICON_STATE_OK,
title,
l10n_util::GetStringFUTF16(
IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTED_SENTENCE_LINK,
« no previous file with comments | « chrome/browser/cocoa/page_info_window_mac.mm ('k') | chrome/browser/gtk/page_info_bubble_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698