OLD | NEW |
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 Loading... |
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 |
OLD | NEW |