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/extensions/crx_installer.h" | 5 #include "chrome/browser/extensions/crx_installer.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
565 chromeos::ScopedUserManagerEnabler scoped_user_manager(fake_user_manager); | 565 chromeos::ScopedUserManagerEnabler scoped_user_manager(fake_user_manager); |
566 EXPECT_TRUE(InstallExtension(crx_path, 1)); | 566 EXPECT_TRUE(InstallExtension(crx_path, 1)); |
567 } | 567 } |
568 | 568 |
569 IN_PROC_BROWSER_TEST_F(ExtensionCrxInstallerTest, InstallToSharedLocation) { | 569 IN_PROC_BROWSER_TEST_F(ExtensionCrxInstallerTest, InstallToSharedLocation) { |
570 base::CommandLine::ForCurrentProcess()->AppendSwitch( | 570 base::CommandLine::ForCurrentProcess()->AppendSwitch( |
571 chromeos::switches::kEnableExtensionAssetsSharing); | 571 chromeos::switches::kEnableExtensionAssetsSharing); |
572 base::ScopedTempDir cache_dir; | 572 base::ScopedTempDir cache_dir; |
573 ASSERT_TRUE(cache_dir.CreateUniqueTempDir()); | 573 ASSERT_TRUE(cache_dir.CreateUniqueTempDir()); |
574 ExtensionAssetsManagerChromeOS::SetSharedInstallDirForTesting( | 574 ExtensionAssetsManagerChromeOS::SetSharedInstallDirForTesting( |
575 cache_dir.path()); | 575 cache_dir.GetPath()); |
576 | 576 |
577 base::FilePath crx_path = test_data_dir_.AppendASCII("crx_installer/v1.crx"); | 577 base::FilePath crx_path = test_data_dir_.AppendASCII("crx_installer/v1.crx"); |
578 const extensions::Extension* extension = InstallExtension( | 578 const extensions::Extension* extension = InstallExtension( |
579 crx_path, 1, extensions::Manifest::EXTERNAL_PREF); | 579 crx_path, 1, extensions::Manifest::EXTERNAL_PREF); |
580 base::FilePath extension_path = extension->path(); | 580 base::FilePath extension_path = extension->path(); |
581 EXPECT_TRUE(cache_dir.path().IsParent(extension_path)); | 581 EXPECT_TRUE(cache_dir.GetPath().IsParent(extension_path)); |
582 EXPECT_TRUE(base::PathExists(extension_path)); | 582 EXPECT_TRUE(base::PathExists(extension_path)); |
583 | 583 |
584 std::string extension_id = extension->id(); | 584 std::string extension_id = extension->id(); |
585 UninstallExtension(extension_id); | 585 UninstallExtension(extension_id); |
586 ExtensionRegistry* registry = ExtensionRegistry::Get( | 586 ExtensionRegistry* registry = ExtensionRegistry::Get( |
587 browser()->profile()); | 587 browser()->profile()); |
588 EXPECT_FALSE(registry->enabled_extensions().GetByID(extension_id)); | 588 EXPECT_FALSE(registry->enabled_extensions().GetByID(extension_id)); |
589 | 589 |
590 content::RunAllBlockingPoolTasksUntilIdle(); | 590 content::RunAllBlockingPoolTasksUntilIdle(); |
591 | 591 |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
691 EXPECT_TRUE(WaitForCrxInstallerDone()); | 691 EXPECT_TRUE(WaitForCrxInstallerDone()); |
692 const Extension* extension = installer->extension(); | 692 const Extension* extension = installer->extension(); |
693 ASSERT_TRUE(extension); | 693 ASSERT_TRUE(extension); |
694 ASSERT_EQ(extension_id, extension->id()); | 694 ASSERT_EQ(extension_id, extension->id()); |
695 EXPECT_TRUE(ExtensionPrefs::Get(profile())->AllowFileAccess(extension_id)); | 695 EXPECT_TRUE(ExtensionPrefs::Get(profile())->AllowFileAccess(extension_id)); |
696 EXPECT_TRUE(extension->creation_flags() & Extension::ALLOW_FILE_ACCESS); | 696 EXPECT_TRUE(extension->creation_flags() & Extension::ALLOW_FILE_ACCESS); |
697 } | 697 } |
698 } | 698 } |
699 | 699 |
700 } // namespace extensions | 700 } // namespace extensions |
OLD | NEW |