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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 | 157 |
158 // Extension api test for the fileBrowserHandler extension API. | 158 // Extension api test for the fileBrowserHandler extension API. |
159 class FileBrowserHandlerExtensionTest : public ExtensionApiTest { | 159 class FileBrowserHandlerExtensionTest : public ExtensionApiTest { |
160 protected: | 160 protected: |
161 virtual void SetUp() OVERRIDE { | 161 virtual void SetUp() OVERRIDE { |
162 // Create mount point directory that will be used in the test. | 162 // Create mount point directory that will be used in the test. |
163 // Mount point will be called "tmp", and it will be located in a tmp | 163 // Mount point will be called "tmp", and it will be located in a tmp |
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 file_util::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())->RegisterFileSystem( |
175 "tmp", | 175 "tmp", |
176 fileapi::kFileSystemTypeNativeLocal, | 176 fileapi::kFileSystemTypeNativeLocal, |
177 tmp_mount_point_); | 177 tmp_mount_point_); |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 select_file_function.get(), | 366 select_file_function.get(), |
367 "[{\"suggestedName\": \"/path_to_file/some_file_name.txt\"}]", | 367 "[{\"suggestedName\": \"/path_to_file/some_file_name.txt\"}]", |
368 browser()))); | 368 browser()))); |
369 | 369 |
370 EXPECT_FALSE(utils::GetBoolean(result.get(), "success")); | 370 EXPECT_FALSE(utils::GetBoolean(result.get(), "success")); |
371 DictionaryValue* entry_info; | 371 DictionaryValue* entry_info; |
372 EXPECT_FALSE(result->GetDictionary("entry", &entry_info)); | 372 EXPECT_FALSE(result->GetDictionary("entry", &entry_info)); |
373 } | 373 } |
374 | 374 |
375 } // namespace | 375 } // namespace |
OLD | NEW |