diff options
author | yoz@chromium.org <yoz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-11 21:33:11 +0000 |
---|---|---|
committer | yoz@chromium.org <yoz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-11 21:33:11 +0000 |
commit | 54fb19868129ba44e51557203d57677bc6ee72fa (patch) | |
tree | 8942d91323e44c046475af5ab14f5445e92f588d /chrome/browser/extensions | |
parent | 3329acbc35040c3b029082253c0dc95a247f6690 (diff) | |
download | chromium_src-54fb19868129ba44e51557203d57677bc6ee72fa.zip chromium_src-54fb19868129ba44e51557203d57677bc6ee72fa.tar.gz chromium_src-54fb19868129ba44e51557203d57677bc6ee72fa.tar.bz2 |
Use unpacked extension test data in ExtensionManagementApiEscalationTest.
Review URL: https://chromiumcodereview.appspot.com/10052002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@131841 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions')
-rw-r--r-- | chrome/browser/extensions/extension_management_api_browsertest.cc | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/chrome/browser/extensions/extension_management_api_browsertest.cc b/chrome/browser/extensions/extension_management_api_browsertest.cc index 9966f01..edc25c7 100644 --- a/chrome/browser/extensions/extension_management_api_browsertest.cc +++ b/chrome/browser/extensions/extension_management_api_browsertest.cc @@ -3,6 +3,8 @@ // found in the LICENSE file. #include "base/command_line.h" +#include "base/file_path.h" +#include "base/scoped_temp_dir.h" #include "base/stringprintf.h" #include "chrome/browser/extensions/extension_browsertest.h" #include "chrome/browser/extensions/extension_function_test_utils.h" @@ -64,16 +66,28 @@ class ExtensionManagementApiEscalationTest : public ExtensionBrowserTest { static const char kId[]; virtual void SetUpOnMainThread() OVERRIDE { + EXPECT_TRUE(scoped_temp_dir_.CreateUniqueTempDir()); + FilePath pem_path = test_data_dir_. + AppendASCII("permissions_increase").AppendASCII("permissions.pem"); + FilePath path_v1 = PackExtensionWithOptions( + test_data_dir_.AppendASCII("permissions_increase").AppendASCII("v1"), + scoped_temp_dir_.path().AppendASCII("permissions1.crx"), + pem_path, + FilePath()); + FilePath path_v2 = PackExtensionWithOptions( + test_data_dir_.AppendASCII("permissions_increase").AppendASCII("v2"), + scoped_temp_dir_.path().AppendASCII("permissions2.crx"), + pem_path, + FilePath()); + ExtensionService* service = browser()->profile()->GetExtensionService(); // Install low-permission version of the extension. - ASSERT_TRUE(InstallExtension( - test_data_dir_.AppendASCII("permissions-low-v1.crx"), 1)); + ASSERT_TRUE(InstallExtension(path_v1, 1)); EXPECT_TRUE(service->GetExtensionById(kId, false) != NULL); // Update to a high-permission version - it should get disabled. - EXPECT_FALSE(UpdateExtension( - kId, test_data_dir_.AppendASCII("permissions-high-v2.crx"), -1)); + EXPECT_FALSE(UpdateExtension(kId, path_v2, -1)); EXPECT_TRUE(service->GetExtensionById(kId, false) == NULL); EXPECT_TRUE(service->GetExtensionById(kId, true) != NULL); EXPECT_TRUE( @@ -97,6 +111,8 @@ class ExtensionManagementApiEscalationTest : public ExtensionBrowserTest { } } + private: + ScopedTempDir scoped_temp_dir_; }; const char ExtensionManagementApiEscalationTest::kId[] = |