| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // File contains browser tests for the fileBrowserHandler api. | 5 // File contains browser tests for the fileBrowserHandler api. |
| 6 | 6 |
| 7 #include "chrome/browser/chromeos/extensions/file_manager/file_browser_handler_a
pi.h" | 7 #include "chrome/browser/chromeos/extensions/file_manager/file_browser_handler_a
pi.h" |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 // directory with an unique name. | 164 // directory with an unique name. |
| 165 ASSERT_TRUE(scoped_tmp_dir_.CreateUniqueTempDir()); | 165 ASSERT_TRUE(scoped_tmp_dir_.CreateUniqueTempDir()); |
| 166 tmp_mount_point_ = scoped_tmp_dir_.path().Append("tmp"); | 166 tmp_mount_point_ = scoped_tmp_dir_.path().Append("tmp"); |
| 167 base::CreateDirectory(tmp_mount_point_); | 167 base::CreateDirectory(tmp_mount_point_); |
| 168 | 168 |
| 169 ExtensionApiTest::SetUp(); | 169 ExtensionApiTest::SetUp(); |
| 170 } | 170 } |
| 171 | 171 |
| 172 // Creates new, test mount point. | 172 // Creates new, test mount point. |
| 173 void AddTmpMountPoint(const std::string& extension_id) { | 173 void AddTmpMountPoint(const std::string& extension_id) { |
| 174 BrowserContext::GetMountPoints(browser()->profile())->RegisterFileSystem( | 174 BrowserContext::GetMountPoints(browser()->profile()) |
| 175 "tmp", | 175 ->RegisterFileSystem("tmp", |
| 176 fileapi::kFileSystemTypeNativeLocal, | 176 storage::kFileSystemTypeNativeLocal, |
| 177 fileapi::FileSystemMountOption(), | 177 storage::FileSystemMountOption(), |
| 178 tmp_mount_point_); | 178 tmp_mount_point_); |
| 179 } | 179 } |
| 180 | 180 |
| 181 base::FilePath GetFullPathOnTmpMountPoint( | 181 base::FilePath GetFullPathOnTmpMountPoint( |
| 182 const base::FilePath& relative_path) { | 182 const base::FilePath& relative_path) { |
| 183 return tmp_mount_point_.Append(relative_path); | 183 return tmp_mount_point_.Append(relative_path); |
| 184 } | 184 } |
| 185 | 185 |
| 186 // Creates a new FileBrowserHandlerInternalSelectFileFunction to be used in | 186 // Creates a new FileBrowserHandlerInternalSelectFileFunction to be used in |
| 187 // the test. This function will be called from ExtensionFunctinoDispatcher | 187 // the test. This function will be called from ExtensionFunctinoDispatcher |
| 188 // whenever an extension function for fileBrowserHandlerInternal.selectFile | 188 // whenever an extension function for fileBrowserHandlerInternal.selectFile |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 select_file_function.get(), | 367 select_file_function.get(), |
| 368 "[{\"suggestedName\": \"/path_to_file/some_file_name.txt\"}]", | 368 "[{\"suggestedName\": \"/path_to_file/some_file_name.txt\"}]", |
| 369 browser()))); | 369 browser()))); |
| 370 | 370 |
| 371 EXPECT_FALSE(utils::GetBoolean(result.get(), "success")); | 371 EXPECT_FALSE(utils::GetBoolean(result.get(), "success")); |
| 372 base::DictionaryValue* entry_info; | 372 base::DictionaryValue* entry_info; |
| 373 EXPECT_FALSE(result->GetDictionary("entry", &entry_info)); | 373 EXPECT_FALSE(result->GetDictionary("entry", &entry_info)); |
| 374 } | 374 } |
| 375 | 375 |
| 376 } // namespace | 376 } // namespace |
| OLD | NEW |