| 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 "chrome/browser/custom_handlers/protocol_handler_registry.h" | 5 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 force_failure_(force_failure) {} | 147 force_failure_(force_failure) {} |
| 148 | 148 |
| 149 private: | 149 private: |
| 150 ~FakeProtocolClientWorker() override = default; | 150 ~FakeProtocolClientWorker() override = default; |
| 151 | 151 |
| 152 shell_integration::DefaultWebClientState CheckIsDefaultImpl() override { | 152 shell_integration::DefaultWebClientState CheckIsDefaultImpl() override { |
| 153 return force_failure_ ? shell_integration::NOT_DEFAULT | 153 return force_failure_ ? shell_integration::NOT_DEFAULT |
| 154 : shell_integration::IS_DEFAULT; | 154 : shell_integration::IS_DEFAULT; |
| 155 } | 155 } |
| 156 | 156 |
| 157 AttemptResult SetAsDefaultImpl() override { return AttemptResult::SUCCESS; } | 157 void SetAsDefaultImpl() override {} |
| 158 | 158 |
| 159 private: | 159 private: |
| 160 bool force_failure_; | 160 bool force_failure_; |
| 161 }; | 161 }; |
| 162 | 162 |
| 163 class FakeDelegate : public ProtocolHandlerRegistry::Delegate { | 163 class FakeDelegate : public ProtocolHandlerRegistry::Delegate { |
| 164 public: | 164 public: |
| 165 FakeDelegate() : force_os_failure_(false) {} | 165 FakeDelegate() : force_os_failure_(false) {} |
| 166 ~FakeDelegate() override {} | 166 ~FakeDelegate() override {} |
| 167 void RegisterExternalHandler(const std::string& protocol) override { | 167 void RegisterExternalHandler(const std::string& protocol) override { |
| (...skipping 909 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1077 // added to pref. | 1077 // added to pref. |
| 1078 ASSERT_EQ(InPrefIgnoredHandlerCount(), 2); | 1078 ASSERT_EQ(InPrefIgnoredHandlerCount(), 2); |
| 1079 ASSERT_EQ(InMemoryIgnoredHandlerCount(), 4); | 1079 ASSERT_EQ(InMemoryIgnoredHandlerCount(), 4); |
| 1080 | 1080 |
| 1081 registry()->RemoveIgnoredHandler(p2u1); | 1081 registry()->RemoveIgnoredHandler(p2u1); |
| 1082 | 1082 |
| 1083 // p2u1 installed by user and policy, so it is removed from pref alone. | 1083 // p2u1 installed by user and policy, so it is removed from pref alone. |
| 1084 ASSERT_EQ(InPrefIgnoredHandlerCount(), 1); | 1084 ASSERT_EQ(InPrefIgnoredHandlerCount(), 1); |
| 1085 ASSERT_EQ(InMemoryIgnoredHandlerCount(), 4); | 1085 ASSERT_EQ(InMemoryIgnoredHandlerCount(), 4); |
| 1086 } | 1086 } |
| OLD | NEW |