| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 ADD_FAILURE(); | 135 ADD_FAILURE(); |
| 136 return false; | 136 return false; |
| 137 } | 137 } |
| 138 | 138 |
| 139 std::unique_ptr<ComponentInfo> GetComponentForMimeType( | 139 std::unique_ptr<ComponentInfo> GetComponentForMimeType( |
| 140 const std::string& mime_type) const override { | 140 const std::string& mime_type) const override { |
| 141 return nullptr; | 141 return nullptr; |
| 142 } | 142 } |
| 143 | 143 |
| 144 // OnDemandUpdater implementation: | 144 // OnDemandUpdater implementation: |
| 145 bool OnDemandUpdate(const std::string& crx_id) override { | 145 void OnDemandUpdate( |
| 146 const std::string& crx_id, |
| 147 ComponentUpdateService::CompletionCallback callback) override { |
| 146 on_demand_update_called_ = true; | 148 on_demand_update_called_ = true; |
| 147 | 149 |
| 148 if (!component_) { | 150 if (!component_) { |
| 149 ADD_FAILURE() << "Trying to update unregistered component " << crx_id; | 151 ADD_FAILURE() << "Trying to update unregistered component " << crx_id; |
| 150 return false; | 152 return; |
| 151 } | 153 } |
| 152 | 154 |
| 153 EXPECT_EQ(GetCrxComponentID(*component_), crx_id); | 155 EXPECT_EQ(GetCrxComponentID(*component_), crx_id); |
| 154 return true; | |
| 155 } | 156 } |
| 156 | 157 |
| 157 private: | 158 private: |
| 158 scoped_refptr<base::SequencedTaskRunner> task_runner_; | 159 scoped_refptr<base::SequencedTaskRunner> task_runner_; |
| 159 std::unique_ptr<CrxComponent> component_; | 160 std::unique_ptr<CrxComponent> component_; |
| 160 base::Closure registration_callback_; | 161 base::Closure registration_callback_; |
| 161 bool on_demand_update_called_; | 162 bool on_demand_update_called_; |
| 162 }; | 163 }; |
| 163 | 164 |
| 164 class WhitelistLoadObserver { | 165 class WhitelistLoadObserver { |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 // but it exercises a different code path. | 424 // but it exercises a different code path. |
| 424 profile_attributes_storage()->RemoveProfile(GetProfilePath(kOtherClientId)); | 425 profile_attributes_storage()->RemoveProfile(GetProfilePath(kOtherClientId)); |
| 425 run_loop.RunUntilIdle(); | 426 run_loop.RunUntilIdle(); |
| 426 } | 427 } |
| 427 EXPECT_FALSE(component_update_service_.registered_component()); | 428 EXPECT_FALSE(component_update_service_.registered_component()); |
| 428 EXPECT_FALSE(base::DirectoryExists(whitelist_directory_)); | 429 EXPECT_FALSE(base::DirectoryExists(whitelist_directory_)); |
| 429 EXPECT_FALSE(base::PathExists(whitelist_path_)); | 430 EXPECT_FALSE(base::PathExists(whitelist_path_)); |
| 430 } | 431 } |
| 431 | 432 |
| 432 } // namespace component_updater | 433 } // namespace component_updater |
| OLD | NEW |