| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include <memory> |
| 8 |
| 7 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 8 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
| 10 #include "base/test/scoped_feature_list.h" | 12 #include "base/test/scoped_feature_list.h" |
| 11 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" | 13 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" |
| 12 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 14 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
| 13 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" | 15 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" |
| 14 #include "chrome/browser/infobars/infobar_service.h" | 16 #include "chrome/browser/infobars/infobar_service.h" |
| 15 #include "chrome/browser/media/webrtc/media_capture_devices_dispatcher.h" | 17 #include "chrome/browser/media/webrtc/media_capture_devices_dispatcher.h" |
| 16 #include "chrome/browser/media/webrtc/media_stream_capture_indicator.h" | 18 #include "chrome/browser/media/webrtc/media_stream_capture_indicator.h" |
| (...skipping 835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 852 } | 854 } |
| 853 | 855 |
| 854 class FakeDelegate : public ProtocolHandlerRegistry::Delegate { | 856 class FakeDelegate : public ProtocolHandlerRegistry::Delegate { |
| 855 public: | 857 public: |
| 856 void RegisterExternalHandler(const std::string& protocol) override { | 858 void RegisterExternalHandler(const std::string& protocol) override { |
| 857 // Overrides in order to not register the handler with the | 859 // Overrides in order to not register the handler with the |
| 858 // ChildProcessSecurityPolicy. That has persistent and unalterable | 860 // ChildProcessSecurityPolicy. That has persistent and unalterable |
| 859 // side effects on other tests. | 861 // side effects on other tests. |
| 860 } | 862 } |
| 861 | 863 |
| 862 scoped_refptr<shell_integration::DefaultProtocolClientWorker> | |
| 863 CreateShellWorker( | |
| 864 const shell_integration::DefaultWebClientWorkerCallback& callback, | |
| 865 const std::string& protocol) override { | |
| 866 VLOG(1) << "CreateShellWorker"; | |
| 867 return NULL; | |
| 868 } | |
| 869 | |
| 870 void RegisterWithOSAsDefaultClient( | 864 void RegisterWithOSAsDefaultClient( |
| 871 const std::string& protocol, | 865 const std::string& protocol, |
| 872 ProtocolHandlerRegistry* registry) override { | 866 ProtocolHandlerRegistry* registry) override { |
| 873 VLOG(1) << "Register With OS"; | 867 VLOG(1) << "Register With OS"; |
| 874 } | 868 } |
| 875 }; | 869 }; |
| 876 | 870 |
| 877 TEST_F(ContentSettingBubbleModelTest, RPHAllow) { | 871 TEST_F(ContentSettingBubbleModelTest, RPHAllow) { |
| 878 ProtocolHandlerRegistry registry(profile(), new FakeDelegate()); | 872 ProtocolHandlerRegistry registry(profile(), new FakeDelegate()); |
| 879 registry.InitProtocolSettings(); | 873 registry.InitProtocolSettings(); |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 985 content_settings->OnContentBlocked(CONTENT_SETTINGS_TYPE_COOKIES); | 979 content_settings->OnContentBlocked(CONTENT_SETTINGS_TYPE_COOKIES); |
| 986 | 980 |
| 987 std::unique_ptr<ContentSettingBubbleModel> content_setting_bubble_model( | 981 std::unique_ptr<ContentSettingBubbleModel> content_setting_bubble_model( |
| 988 ContentSettingBubbleModel::CreateContentSettingBubbleModel( | 982 ContentSettingBubbleModel::CreateContentSettingBubbleModel( |
| 989 NULL, web_contents(), profile(), CONTENT_SETTINGS_TYPE_COOKIES)); | 983 NULL, web_contents(), profile(), CONTENT_SETTINGS_TYPE_COOKIES)); |
| 990 const ContentSettingBubbleModel::BubbleContent& bubble_content = | 984 const ContentSettingBubbleModel::BubbleContent& bubble_content = |
| 991 content_setting_bubble_model->bubble_content(); | 985 content_setting_bubble_model->bubble_content(); |
| 992 | 986 |
| 993 EXPECT_FALSE(bubble_content.radio_group_enabled); | 987 EXPECT_FALSE(bubble_content.radio_group_enabled); |
| 994 } | 988 } |
| OLD | NEW |