| 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 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 registration_run_loop.Run(); | 339 registration_run_loop.Run(); |
| 340 | 340 |
| 341 ASSERT_NO_FATAL_FAILURE(CheckRegisteredComponent("0.0.0.0")); | 341 ASSERT_NO_FATAL_FAILURE(CheckRegisteredComponent("0.0.0.0")); |
| 342 EXPECT_TRUE(component_update_service_.on_demand_update_called()); | 342 EXPECT_TRUE(component_update_service_.on_demand_update_called()); |
| 343 | 343 |
| 344 // Registering the same whitelist for another client should not do anything. | 344 // Registering the same whitelist for another client should not do anything. |
| 345 installer_->RegisterWhitelist(kOtherClientId, kCrxId, kName); | 345 installer_->RegisterWhitelist(kOtherClientId, kCrxId, kName); |
| 346 | 346 |
| 347 base::ScopedTempDir temp_dir; | 347 base::ScopedTempDir temp_dir; |
| 348 ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); | 348 ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); |
| 349 base::FilePath unpacked_path = temp_dir.path(); | 349 base::FilePath unpacked_path = temp_dir.GetPath(); |
| 350 ASSERT_NO_FATAL_FAILURE(PrepareWhitelistDirectory(unpacked_path)); | 350 ASSERT_NO_FATAL_FAILURE(PrepareWhitelistDirectory(unpacked_path)); |
| 351 | 351 |
| 352 const CrxComponent* component = | 352 const CrxComponent* component = |
| 353 component_update_service_.registered_component(); | 353 component_update_service_.registered_component(); |
| 354 ASSERT_TRUE(component); | 354 ASSERT_TRUE(component); |
| 355 EXPECT_TRUE(component->installer->Install(manifest_, unpacked_path)); | 355 EXPECT_TRUE(component->installer->Install(manifest_, unpacked_path)); |
| 356 | 356 |
| 357 observer.Wait(); | 357 observer.Wait(); |
| 358 EXPECT_EQ(whitelist_path_.value(), observer.whitelist_path().value()); | 358 EXPECT_EQ(whitelist_path_.value(), observer.whitelist_path().value()); |
| 359 EXPECT_EQ(large_icon_path_.value(), observer.large_icon_path().value()); | 359 EXPECT_EQ(large_icon_path_.value(), observer.large_icon_path().value()); |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 // but it exercises a different code path. | 424 // but it exercises a different code path. |
| 425 profile_attributes_storage()->RemoveProfile(GetProfilePath(kOtherClientId)); | 425 profile_attributes_storage()->RemoveProfile(GetProfilePath(kOtherClientId)); |
| 426 run_loop.RunUntilIdle(); | 426 run_loop.RunUntilIdle(); |
| 427 } | 427 } |
| 428 EXPECT_FALSE(component_update_service_.registered_component()); | 428 EXPECT_FALSE(component_update_service_.registered_component()); |
| 429 EXPECT_FALSE(base::DirectoryExists(whitelist_directory_)); | 429 EXPECT_FALSE(base::DirectoryExists(whitelist_directory_)); |
| 430 EXPECT_FALSE(base::PathExists(whitelist_path_)); | 430 EXPECT_FALSE(base::PathExists(whitelist_path_)); |
| 431 } | 431 } |
| 432 | 432 |
| 433 } // namespace component_updater | 433 } // namespace component_updater |
| OLD | NEW |