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

Unified Diff: chrome/browser/extensions/extension_downloads_apitest.cc

Issue 8418009: DownloadsApiTest uses a ScopedTempDir to clean up after itself. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: no log Created 9 years, 2 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_downloads_apitest.cc
diff --git a/chrome/browser/extensions/extension_downloads_apitest.cc b/chrome/browser/extensions/extension_downloads_apitest.cc
index 79dbf9b3527494c7bcbe6349564fc0b308954a3e..b135e6255db7b86a6ede1be1212dabf3438e5a5b 100644
--- a/chrome/browser/extensions/extension_downloads_apitest.cc
+++ b/chrome/browser/extensions/extension_downloads_apitest.cc
@@ -3,7 +3,11 @@
// found in the LICENSE file.
#include "chrome/browser/extensions/extension_apitest.h"
+#include "chrome/browser/prefs/pref_service.h"
+#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/ui/browser.h"
#include "chrome/common/chrome_switches.h"
+#include "chrome/common/pref_names.h"
class DownloadsApiTest : public ExtensionApiTest {
public:
@@ -11,10 +15,19 @@ class DownloadsApiTest : public ExtensionApiTest {
ExtensionApiTest::SetUpCommandLine(command_line);
command_line->AppendSwitch(switches::kEnableExperimentalExtensionApis);
}
+
+ void SetUpTempDownloadsDir() {
+ ASSERT_TRUE(tmpdir.CreateUniqueTempDir());
+ browser()->profile()->GetPrefs()->SetFilePath(
+ prefs::kDownloadDefaultDirectory, tmpdir.path());
+ }
+
+ private:
+ ScopedTempDir tmpdir;
};
-// Disabled: see http://crbug.com/101170
-IN_PROC_BROWSER_TEST_F(DownloadsApiTest, DISABLED_Downloads) {
+IN_PROC_BROWSER_TEST_F(DownloadsApiTest, Downloads) {
+ SetUpTempDownloadsDir();
ASSERT_TRUE(StartTestServer());
ASSERT_TRUE(RunExtensionTest("downloads")) << message_;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698