| 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 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 EXPECT_TRUE(extension->permissions_data()->HasAPIPermission( | 338 EXPECT_TRUE(extension->permissions_data()->HasAPIPermission( |
| 339 APIPermission::kExperimental)); | 339 APIPermission::kExperimental)); |
| 340 } | 340 } |
| 341 | 341 |
| 342 IN_PROC_BROWSER_TEST_F(ExtensionCrxInstallerTestWithExperimentalApis, | 342 IN_PROC_BROWSER_TEST_F(ExtensionCrxInstallerTestWithExperimentalApis, |
| 343 PlatformAppCrx) { | 343 PlatformAppCrx) { |
| 344 EXPECT_TRUE(InstallExtension( | 344 EXPECT_TRUE(InstallExtension( |
| 345 test_data_dir_.AppendASCII("minimal_platform_app.crx"), 1)); | 345 test_data_dir_.AppendASCII("minimal_platform_app.crx"), 1)); |
| 346 } | 346 } |
| 347 | 347 |
| 348 IN_PROC_BROWSER_TEST_F(ExtensionCrxInstallerTest, BlockedFileTypes) { |
| 349 const Extension* extension = |
| 350 InstallExtension(test_data_dir_.AppendASCII("blocked_file_types.crx"), 1); |
| 351 EXPECT_TRUE(base::PathExists(extension->path().AppendASCII("test.html"))); |
| 352 EXPECT_TRUE(base::PathExists(extension->path().AppendASCII("test.nexe"))); |
| 353 EXPECT_FALSE(base::PathExists(extension->path().AppendASCII("test1.EXE"))); |
| 354 EXPECT_FALSE(base::PathExists(extension->path().AppendASCII("test2.exe"))); |
| 355 } |
| 356 |
| 348 IN_PROC_BROWSER_TEST_F(ExtensionCrxInstallerTest, PackAndInstallExtension) { | 357 IN_PROC_BROWSER_TEST_F(ExtensionCrxInstallerTest, PackAndInstallExtension) { |
| 349 if (!FeatureSwitch::easy_off_store_install()->IsEnabled()) | 358 if (!FeatureSwitch::easy_off_store_install()->IsEnabled()) |
| 350 return; | 359 return; |
| 351 | 360 |
| 352 const int kNumDownloadsExpected = 1; | 361 const int kNumDownloadsExpected = 1; |
| 353 | 362 |
| 354 LOG(ERROR) << "PackAndInstallExtension: Packing extension"; | 363 LOG(ERROR) << "PackAndInstallExtension: Packing extension"; |
| 355 base::FilePath crx_path = PackExtension( | 364 base::FilePath crx_path = PackExtension( |
| 356 test_data_dir_.AppendASCII("common/background_page")); | 365 test_data_dir_.AppendASCII("common/background_page")); |
| 357 ASSERT_FALSE(crx_path.empty()); | 366 ASSERT_FALSE(crx_path.empty()); |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 691 EXPECT_TRUE(WaitForCrxInstallerDone()); | 700 EXPECT_TRUE(WaitForCrxInstallerDone()); |
| 692 const Extension* extension = installer->extension(); | 701 const Extension* extension = installer->extension(); |
| 693 ASSERT_TRUE(extension); | 702 ASSERT_TRUE(extension); |
| 694 ASSERT_EQ(extension_id, extension->id()); | 703 ASSERT_EQ(extension_id, extension->id()); |
| 695 EXPECT_TRUE(ExtensionPrefs::Get(profile())->AllowFileAccess(extension_id)); | 704 EXPECT_TRUE(ExtensionPrefs::Get(profile())->AllowFileAccess(extension_id)); |
| 696 EXPECT_TRUE(extension->creation_flags() & Extension::ALLOW_FILE_ACCESS); | 705 EXPECT_TRUE(extension->creation_flags() & Extension::ALLOW_FILE_ACCESS); |
| 697 } | 706 } |
| 698 } | 707 } |
| 699 | 708 |
| 700 } // namespace extensions | 709 } // namespace extensions |
| OLD | NEW |