Commit c56a0175 authored by asanka@chromium.org's avatar asanka@chromium.org

Create a temp download directory for WebstorePrivateApiTest

This test was writing to the user's downloads directory instead of a
temporary path.

BUG=372017
R=asargent@chromium.org

Review URL: https://codereview.chromium.org/274193008

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@269607 0039d316-1c4b-4281-b951-d872f2087c98
parent 58ddc78c
......@@ -157,6 +157,11 @@ class ExtensionWebstorePrivateApiTest : public ExtensionApiTest {
ProfileOAuth2TokenServiceFactory::GetInstance()->GetForProfile(
profile()));
ASSERT_TRUE(token_service_);
ASSERT_TRUE(webstore_install_dir_.CreateUniqueTempDir());
webstore_install_dir_copy_ = webstore_install_dir_.path();
WebstoreInstaller::SetDownloadDirectoryForTests(
&webstore_install_dir_copy_);
}
protected:
......@@ -223,6 +228,10 @@ class ExtensionWebstorePrivateApiTest : public ExtensionApiTest {
scoped_ptr<base::CallbackList<void(content::BrowserContext*)>::Subscription>
will_create_browser_context_services_subscription_;
base::ScopedTempDir webstore_install_dir_;
// WebstoreInstaller needs a reference to a FilePath when setting the download
// directory for testing.
base::FilePath webstore_install_dir_copy_;
};
// Test cases for webstore origin frame blocking.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment