Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(203)

Side by Side Diff: chrome/browser/component_updater/supervised_user_whitelist_installer_unittest.cc

Issue 2317993003: //chrome/browser and //components A-E: Change ScopedTempDir::path() to GetPath() (Closed)
Patch Set: Just rebased Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698