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

Side by Side 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, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/extension_apitest.h" 5 #include "chrome/browser/extensions/extension_apitest.h"
6 #include "chrome/browser/prefs/pref_service.h"
7 #include "chrome/browser/profiles/profile.h"
8 #include "chrome/browser/ui/browser.h"
6 #include "chrome/common/chrome_switches.h" 9 #include "chrome/common/chrome_switches.h"
10 #include "chrome/common/pref_names.h"
7 11
8 class DownloadsApiTest : public ExtensionApiTest { 12 class DownloadsApiTest : public ExtensionApiTest {
9 public: 13 public:
10 void SetUpCommandLine(CommandLine* command_line) { 14 void SetUpCommandLine(CommandLine* command_line) {
11 ExtensionApiTest::SetUpCommandLine(command_line); 15 ExtensionApiTest::SetUpCommandLine(command_line);
12 command_line->AppendSwitch(switches::kEnableExperimentalExtensionApis); 16 command_line->AppendSwitch(switches::kEnableExperimentalExtensionApis);
13 } 17 }
18
19 void SetUpTempDownloadsDir() {
20 ASSERT_TRUE(tmpdir.CreateUniqueTempDir());
21 browser()->profile()->GetPrefs()->SetFilePath(
22 prefs::kDownloadDefaultDirectory, tmpdir.path());
23 }
24
25 private:
26 ScopedTempDir tmpdir;
14 }; 27 };
15 28
16 // Disabled: see http://crbug.com/101170 29 IN_PROC_BROWSER_TEST_F(DownloadsApiTest, Downloads) {
17 IN_PROC_BROWSER_TEST_F(DownloadsApiTest, DISABLED_Downloads) { 30 SetUpTempDownloadsDir();
18 ASSERT_TRUE(StartTestServer()); 31 ASSERT_TRUE(StartTestServer());
19 ASSERT_TRUE(RunExtensionTest("downloads")) << message_; 32 ASSERT_TRUE(RunExtensionTest("downloads")) << message_;
20 } 33 }
OLDNEW
« 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