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

Side by Side Diff: chrome/browser/ui/content_settings/content_setting_image_model_unittest.cc

Issue 2785923003: [subresource_filter] Clean up special cases in TabSpecificContentSettings (Closed)
Patch Set: remove dependent CL Created 3 years, 8 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
« no previous file with comments | « chrome/browser/ui/content_settings/content_setting_image_model.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "base/macros.h" 5 #include "base/macros.h"
6 #include "base/strings/utf_string_conversions.h" 6 #include "base/strings/utf_string_conversions.h"
7 #include "chrome/browser/chrome_notification_types.h" 7 #include "chrome/browser/chrome_notification_types.h"
8 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" 8 #include "chrome/browser/content_settings/host_content_settings_map_factory.h"
9 #include "chrome/browser/content_settings/tab_specific_content_settings.h" 9 #include "chrome/browser/content_settings/tab_specific_content_settings.h"
10 #include "chrome/browser/prerender/prerender_manager.h" 10 #include "chrome/browser/prerender/prerender_manager.h"
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 135
136 TEST_F(ContentSettingImageModelTest, SubresourceFilter) { 136 TEST_F(ContentSettingImageModelTest, SubresourceFilter) {
137 TabSpecificContentSettings::CreateForWebContents(web_contents()); 137 TabSpecificContentSettings::CreateForWebContents(web_contents());
138 TabSpecificContentSettings* content_settings = 138 TabSpecificContentSettings* content_settings =
139 TabSpecificContentSettings::FromWebContents(web_contents()); 139 TabSpecificContentSettings::FromWebContents(web_contents());
140 std::unique_ptr<ContentSettingImageModel> content_setting_image_model( 140 std::unique_ptr<ContentSettingImageModel> content_setting_image_model(
141 new ContentSettingSubresourceFilterImageModel()); 141 new ContentSettingSubresourceFilterImageModel());
142 EXPECT_FALSE(content_setting_image_model->is_visible()); 142 EXPECT_FALSE(content_setting_image_model->is_visible());
143 EXPECT_TRUE(content_setting_image_model->get_tooltip().empty()); 143 EXPECT_TRUE(content_setting_image_model->get_tooltip().empty());
144 144
145 content_settings->SetSubresourceBlocked(true); 145 content_settings->OnContentBlocked(CONTENT_SETTINGS_TYPE_SUBRESOURCE_FILTER);
146 content_setting_image_model->UpdateFromWebContents(web_contents()); 146 content_setting_image_model->UpdateFromWebContents(web_contents());
147 147
148 EXPECT_TRUE(content_setting_image_model->is_visible()); 148 EXPECT_TRUE(content_setting_image_model->is_visible());
149 EXPECT_TRUE(HasIcon(*content_setting_image_model)); 149 EXPECT_TRUE(HasIcon(*content_setting_image_model));
150 EXPECT_FALSE(content_setting_image_model->get_tooltip().empty()); 150 EXPECT_FALSE(content_setting_image_model->get_tooltip().empty());
151 } 151 }
152 152
153 } // namespace 153 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/ui/content_settings/content_setting_image_model.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698