OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/auto_reset.h" | 5 #include "base/auto_reset.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "chrome/browser/content_settings/host_content_settings_map.h" | 7 #include "chrome/browser/content_settings/host_content_settings_map.h" |
8 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 8 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/ui/content_settings/content_setting_bubble_model.h" | 10 #include "chrome/browser/ui/content_settings/content_setting_bubble_model.h" |
11 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 11 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
12 #include "chrome/browser/ui/tab_contents/test_tab_contents_wrapper.h" | 12 #include "chrome/browser/ui/tab_contents/test_tab_contents_wrapper.h" |
13 #include "chrome/common/chrome_switches.h" | 13 #include "chrome/common/chrome_switches.h" |
14 #include "chrome/test/base/testing_profile.h" | 14 #include "chrome/test/base/testing_profile.h" |
15 #include "content/browser/tab_contents/test_tab_contents.h" | 15 #include "content/browser/tab_contents/test_tab_contents.h" |
16 #include "content/test/test_browser_thread.h" | 16 #include "content/test/test_browser_thread.h" |
17 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
18 | 18 |
| 19 using content::BrowserThread; |
| 20 |
19 class ContentSettingBubbleModelTest : public TabContentsWrapperTestHarness { | 21 class ContentSettingBubbleModelTest : public TabContentsWrapperTestHarness { |
20 protected: | 22 protected: |
21 ContentSettingBubbleModelTest() | 23 ContentSettingBubbleModelTest() |
22 : ui_thread_(BrowserThread::UI, MessageLoop::current()) { | 24 : ui_thread_(BrowserThread::UI, MessageLoop::current()) { |
23 } | 25 } |
24 | 26 |
25 void CheckGeolocationBubble(size_t expected_domains, | 27 void CheckGeolocationBubble(size_t expected_domains, |
26 bool expect_clear_link, | 28 bool expect_clear_link, |
27 bool expect_reload_hint) { | 29 bool expect_reload_hint) { |
28 scoped_ptr<ContentSettingBubbleModel> content_setting_bubble_model( | 30 scoped_ptr<ContentSettingBubbleModel> content_setting_bubble_model( |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 std::string file_url("file:///tmp/test.html"); | 214 std::string file_url("file:///tmp/test.html"); |
213 NavigateAndCommit(GURL(file_url)); | 215 NavigateAndCommit(GURL(file_url)); |
214 scoped_ptr<ContentSettingBubbleModel> content_setting_bubble_model( | 216 scoped_ptr<ContentSettingBubbleModel> content_setting_bubble_model( |
215 ContentSettingBubbleModel::CreateContentSettingBubbleModel( | 217 ContentSettingBubbleModel::CreateContentSettingBubbleModel( |
216 NULL, contents_wrapper(), profile(), | 218 NULL, contents_wrapper(), profile(), |
217 CONTENT_SETTINGS_TYPE_IMAGES)); | 219 CONTENT_SETTINGS_TYPE_IMAGES)); |
218 std::string title = | 220 std::string title = |
219 content_setting_bubble_model->bubble_content().radio_group.radio_items[0]; | 221 content_setting_bubble_model->bubble_content().radio_group.radio_items[0]; |
220 ASSERT_NE(std::string::npos, title.find(file_url)); | 222 ASSERT_NE(std::string::npos, title.find(file_url)); |
221 } | 223 } |
OLD | NEW |