| 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/auto_reset.h" | 5 #include "base/auto_reset.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "chrome/browser/content_settings/host_content_settings_map.h" | 8 #include "chrome/browser/content_settings/host_content_settings_map.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/custom_handlers/protocol_handler_registry.h" | 10 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" |
| 11 #include "chrome/browser/infobars/infobar_delegate.h" | 11 #include "chrome/browser/infobars/infobar_delegate.h" |
| 12 #include "chrome/browser/infobars/infobar_manager.h" |
| 12 #include "chrome/browser/infobars/infobar_service.h" | 13 #include "chrome/browser/infobars/infobar_service.h" |
| 13 #include "chrome/browser/media/media_capture_devices_dispatcher.h" | 14 #include "chrome/browser/media/media_capture_devices_dispatcher.h" |
| 14 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
| 15 #include "chrome/browser/ui/content_settings/content_setting_bubble_model.h" | 16 #include "chrome/browser/ui/content_settings/content_setting_bubble_model.h" |
| 16 #include "chrome/common/chrome_switches.h" | 17 #include "chrome/common/chrome_switches.h" |
| 17 #include "chrome/common/content_settings.h" | 18 #include "chrome/common/content_settings.h" |
| 18 #include "chrome/test/base/chrome_render_view_host_test_harness.h" | 19 #include "chrome/test/base/chrome_render_view_host_test_harness.h" |
| 19 #include "chrome/test/base/testing_profile.h" | 20 #include "chrome/test/base/testing_profile.h" |
| 20 #include "content/public/browser/web_contents.h" | 21 #include "content/public/browser/web_contents.h" |
| 21 #include "content/public/test/web_contents_tester.h" | 22 #include "content/public/test/web_contents_tester.h" |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 std::string())); | 230 std::string())); |
| 230 EXPECT_EQ(CONTENT_SETTING_ALLOW, | 231 EXPECT_EQ(CONTENT_SETTING_ALLOW, |
| 231 host_content_settings_map->GetContentSetting( | 232 host_content_settings_map->GetContentSetting( |
| 232 url, | 233 url, |
| 233 url, | 234 url, |
| 234 CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, | 235 CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, |
| 235 std::string())); | 236 std::string())); |
| 236 | 237 |
| 237 InfoBarService* infobar_service = | 238 InfoBarService* infobar_service = |
| 238 InfoBarService::FromWebContents(web_contents()); | 239 InfoBarService::FromWebContents(web_contents()); |
| 239 infobar_service->RemoveInfoBar(infobar_service->infobar_at(0)); | 240 infobar_service->infobar_manager().RemoveInfoBar( |
| 241 infobar_service->infobar_manager().infobar_at(0)); |
| 240 } | 242 } |
| 241 | 243 |
| 242 TEST_F(ContentSettingBubbleModelTest, MediastreamMic) { | 244 TEST_F(ContentSettingBubbleModelTest, MediastreamMic) { |
| 243 // Required to break dependency on BrowserMainLoop. | 245 // Required to break dependency on BrowserMainLoop. |
| 244 MediaCaptureDevicesDispatcher::GetInstance()-> | 246 MediaCaptureDevicesDispatcher::GetInstance()-> |
| 245 DisableDeviceEnumerationForTesting(); | 247 DisableDeviceEnumerationForTesting(); |
| 246 | 248 |
| 247 TabSpecificContentSettings* content_settings = | 249 TabSpecificContentSettings* content_settings = |
| 248 TabSpecificContentSettings::FromWebContents(web_contents()); | 250 TabSpecificContentSettings::FromWebContents(web_contents()); |
| 249 std::string request_host = "google.com"; | 251 std::string request_host = "google.com"; |
| (...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 663 ProtocolHandler handler = registry.GetHandlerFor("mailto"); | 665 ProtocolHandler handler = registry.GetHandlerFor("mailto"); |
| 664 ASSERT_FALSE(handler.IsEmpty()); | 666 ASSERT_FALSE(handler.IsEmpty()); |
| 665 EXPECT_EQ(base::ASCIIToUTF16("Handler"), handler.title()); | 667 EXPECT_EQ(base::ASCIIToUTF16("Handler"), handler.title()); |
| 666 EXPECT_EQ(CONTENT_SETTING_ALLOW, | 668 EXPECT_EQ(CONTENT_SETTING_ALLOW, |
| 667 content_settings->pending_protocol_handler_setting()); | 669 content_settings->pending_protocol_handler_setting()); |
| 668 EXPECT_FALSE(registry.IsIgnored(test_handler)); | 670 EXPECT_FALSE(registry.IsIgnored(test_handler)); |
| 669 } | 671 } |
| 670 | 672 |
| 671 registry.Shutdown(); | 673 registry.Shutdown(); |
| 672 } | 674 } |
| OLD | NEW |