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

Side by Side Diff: chrome/browser/extensions/crx_installer_browsertest.cc

Issue 1412813003: This CL replaces user_manager::UserID with AccountId. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@468875--Chrome-OS-handles-deletion-of-Gmail-account-poorly--Create-AccountID-structure-part2--user_names
Patch Set: Fix Win GN build. Created 5 years, 1 month 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 (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/extensions/crx_installer.h" 5 #include "chrome/browser/extensions/crx_installer.h"
6 6
7 #include "base/at_exit.h" 7 #include "base/at_exit.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 528
529 IN_PROC_BROWSER_TEST_F(ExtensionCrxInstallerTest, KioskOnlyTest) { 529 IN_PROC_BROWSER_TEST_F(ExtensionCrxInstallerTest, KioskOnlyTest) {
530 base::FilePath crx_path = 530 base::FilePath crx_path =
531 test_data_dir_.AppendASCII("kiosk/kiosk_only.crx"); 531 test_data_dir_.AppendASCII("kiosk/kiosk_only.crx");
532 EXPECT_FALSE(InstallExtension(crx_path, 0)); 532 EXPECT_FALSE(InstallExtension(crx_path, 0));
533 #if defined(OS_CHROMEOS) 533 #if defined(OS_CHROMEOS)
534 // Simulate ChromeOS kiosk mode. |scoped_user_manager| will take over 534 // Simulate ChromeOS kiosk mode. |scoped_user_manager| will take over
535 // lifetime of |user_manager|. 535 // lifetime of |user_manager|.
536 chromeos::FakeChromeUserManager* fake_user_manager = 536 chromeos::FakeChromeUserManager* fake_user_manager =
537 new chromeos::FakeChromeUserManager(); 537 new chromeos::FakeChromeUserManager();
538 fake_user_manager->AddKioskAppUser("example@example.com"); 538 const AccountId account_id(AccountId::FromUserEmail("example@example.com"));
539 fake_user_manager->LoginUser("example@example.com"); 539 fake_user_manager->AddKioskAppUser(account_id);
540 fake_user_manager->LoginUser(account_id);
540 chromeos::ScopedUserManagerEnabler scoped_user_manager(fake_user_manager); 541 chromeos::ScopedUserManagerEnabler scoped_user_manager(fake_user_manager);
541 EXPECT_TRUE(InstallExtension(crx_path, 1)); 542 EXPECT_TRUE(InstallExtension(crx_path, 1));
542 #endif 543 #endif
543 } 544 }
544 545
545 #if defined(OS_CHROMEOS) 546 #if defined(OS_CHROMEOS)
546 IN_PROC_BROWSER_TEST_F(ExtensionCrxInstallerTest, InstallToSharedLocation) { 547 IN_PROC_BROWSER_TEST_F(ExtensionCrxInstallerTest, InstallToSharedLocation) {
547 base::CommandLine::ForCurrentProcess()->AppendSwitch( 548 base::CommandLine::ForCurrentProcess()->AppendSwitch(
548 chromeos::switches::kEnableExtensionAssetsSharing); 549 chromeos::switches::kEnableExtensionAssetsSharing);
549 base::ScopedTempDir cache_dir; 550 base::ScopedTempDir cache_dir;
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 ManagementPolicyMock policy; 592 ManagementPolicyMock policy;
592 extensions::ExtensionSystem::Get(profile()) 593 extensions::ExtensionSystem::Get(profile())
593 ->management_policy() 594 ->management_policy()
594 ->RegisterProvider(&policy); 595 ->RegisterProvider(&policy);
595 596
596 base::FilePath crx_path = test_data_dir_.AppendASCII("crx_installer/v1.crx"); 597 base::FilePath crx_path = test_data_dir_.AppendASCII("crx_installer/v1.crx");
597 EXPECT_FALSE(InstallExtension(crx_path, 0)); 598 EXPECT_FALSE(InstallExtension(crx_path, 0));
598 } 599 }
599 600
600 } // namespace extensions 601 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698