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

Unified Diff: chrome/browser/ui/views/select_file_dialog_extension_browsertest.cc

Issue 8819025: [filebrowser] Fix the browser_tests using invalid mount point. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years 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 | webkit/chromeos/fileapi/cros_mount_point_provider.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/select_file_dialog_extension_browsertest.cc
===================================================================
--- chrome/browser/ui/views/select_file_dialog_extension_browsertest.cc (revision 113190)
+++ chrome/browser/ui/views/select_file_dialog_extension_browsertest.cc (working copy)
@@ -218,7 +218,12 @@
// Add tmp mount point even though this test won't use it directly.
// We need this to make sure that at least one top-level directory exists
// in the file browser.
- FilePath tmp_dir("/tmp");
+ FilePath tmp_dir;
+ PathService::Get(base::DIR_TEMP, &tmp_dir);
+ ScopedTempDir downloads_dir;
+ ASSERT_TRUE(downloads_dir.CreateUniqueTempDirUnderPath(tmp_dir));
+ tmp_dir = downloads_dir.path().Append("Downloads");
+ ASSERT_TRUE(file_util::CreateDirectory(tmp_dir));
AddMountPoint(tmp_dir);
gfx::NativeWindow owning_window = browser()->window()->GetNativeHandle();
@@ -244,8 +249,14 @@
IN_PROC_BROWSER_TEST_F(SelectFileDialogExtensionBrowserTest,
MAYBE_SelectFileAndOpen) {
// Allow the tmp directory to be mounted. We explicitly use /tmp because
- // it it whitelisted for file system access on Chrome OS.
- FilePath tmp_dir("/tmp");
+ // it is whitelisted for file system access on Chrome OS.
+ // File manager looks for Downloads mount point, so use this name.
+ FilePath tmp_dir;
sky 2011/12/07 16:39:16 How about a little refactoring so this code isn't
zel 2011/12/07 19:37:55 Right, please move this to the test fixture instea
+ PathService::Get(base::DIR_TEMP, &tmp_dir);
+ ScopedTempDir downloads_dir;
+ ASSERT_TRUE(downloads_dir.CreateUniqueTempDirUnderPath(tmp_dir));
+ tmp_dir = downloads_dir.path().Append("Downloads");
+ ASSERT_TRUE(file_util::CreateDirectory(tmp_dir));
AddMountPoint(tmp_dir);
// Create a directory with a single file in it. ScopedTempDir will delete
@@ -289,8 +300,14 @@
IN_PROC_BROWSER_TEST_F(SelectFileDialogExtensionBrowserTest,
MAYBE_SelectFileAndSave) {
// Allow the tmp directory to be mounted. We explicitly use /tmp because
- // it it whitelisted for file system access on Chrome OS.
- FilePath tmp_dir("/tmp");
+ // it is whitelisted for file system access on Chrome OS.
+ // File manager looks for Downloads mount point, so use this name.
+ FilePath tmp_dir;
+ PathService::Get(base::DIR_TEMP, &tmp_dir);
+ ScopedTempDir downloads_dir;
+ ASSERT_TRUE(downloads_dir.CreateUniqueTempDirUnderPath(tmp_dir));
+ tmp_dir = downloads_dir.path().Append("Downloads");
+ ASSERT_TRUE(file_util::CreateDirectory(tmp_dir));
AddMountPoint(tmp_dir);
// Create a directory with a single file in it. ScopedTempDir will delete
@@ -331,7 +348,12 @@
// Add tmp mount point even though this test won't use it directly.
// We need this to make sure that at least one top-level directory exists
// in the file browser.
- FilePath tmp_dir("/tmp");
+ FilePath tmp_dir;
+ PathService::Get(base::DIR_TEMP, &tmp_dir);
+ ScopedTempDir downloads_dir;
+ ASSERT_TRUE(downloads_dir.CreateUniqueTempDirUnderPath(tmp_dir));
+ tmp_dir = downloads_dir.path().Append("Downloads");
+ ASSERT_TRUE(file_util::CreateDirectory(tmp_dir));
AddMountPoint(tmp_dir);
gfx::NativeWindow owning_window = browser()->window()->GetNativeHandle();
@@ -365,7 +387,12 @@
// Add tmp mount point even though this test won't use it directly.
// We need this to make sure that at least one top-level directory exists
// in the file browser.
- FilePath tmp_dir("/tmp");
+ FilePath tmp_dir;
+ PathService::Get(base::DIR_TEMP, &tmp_dir);
+ ScopedTempDir downloads_dir;
+ ASSERT_TRUE(downloads_dir.CreateUniqueTempDirUnderPath(tmp_dir));
+ tmp_dir = downloads_dir.path().Append("Downloads");
+ ASSERT_TRUE(file_util::CreateDirectory(tmp_dir));
AddMountPoint(tmp_dir);
gfx::NativeWindow owning_window = browser()->window()->GetNativeHandle();
« no previous file with comments | « no previous file | webkit/chromeos/fileapi/cros_mount_point_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698