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_browser_handler_api.h" | 7 #include "chrome/browser/chromeos/extensions/file_browser_handler_api.h" |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/files/scoped_temp_dir.h" |
12 #include "base/path_service.h" | 13 #include "base/path_service.h" |
13 #include "base/scoped_temp_dir.h" | |
14 #include "base/values.h" | 14 #include "base/values.h" |
15 #include "chrome/browser/extensions/extension_apitest.h" | 15 #include "chrome/browser/extensions/extension_apitest.h" |
16 #include "chrome/browser/extensions/extension_function_test_utils.h" | 16 #include "chrome/browser/extensions/extension_function_test_utils.h" |
17 #include "chrome/browser/profiles/profile.h" | 17 #include "chrome/browser/profiles/profile.h" |
18 #include "chrome/browser/ui/browser.h" | 18 #include "chrome/browser/ui/browser.h" |
19 #include "chrome/test/base/in_process_browser_test.h" | 19 #include "chrome/test/base/in_process_browser_test.h" |
20 #include "chrome/test/base/ui_test_utils.h" | 20 #include "chrome/test/base/ui_test_utils.h" |
21 #include "content/public/browser/browser_context.h" | 21 #include "content/public/browser/browser_context.h" |
22 #include "content/public/browser/storage_partition.h" | 22 #include "content/public/browser/storage_partition.h" |
23 #include "webkit/fileapi/file_system_context.h" | 23 #include "webkit/fileapi/file_system_context.h" |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 current_test_case_ = 0; | 210 current_test_case_ = 0; |
211 } | 211 } |
212 | 212 |
213 private: | 213 private: |
214 // List of test parameters for each extension function invocation that will be | 214 // List of test parameters for each extension function invocation that will be |
215 // made during a test. | 215 // made during a test. |
216 // Should be owned by the test code. | 216 // Should be owned by the test code. |
217 static const std::vector<TestCase>* test_cases_; | 217 static const std::vector<TestCase>* test_cases_; |
218 static size_t current_test_case_; | 218 static size_t current_test_case_; |
219 | 219 |
220 ScopedTempDir scoped_tmp_dir_; | 220 base::ScopedTempDir scoped_tmp_dir_; |
221 // Our test mount point path. | 221 // Our test mount point path. |
222 FilePath tmp_mount_point_; | 222 FilePath tmp_mount_point_; |
223 }; | 223 }; |
224 | 224 |
225 const std::vector<TestCase>* FileBrowserHandlerExtensionTest::test_cases_ = | 225 const std::vector<TestCase>* FileBrowserHandlerExtensionTest::test_cases_ = |
226 NULL; | 226 NULL; |
227 size_t FileBrowserHandlerExtensionTest::current_test_case_ = 0; | 227 size_t FileBrowserHandlerExtensionTest::current_test_case_ = 0; |
228 | 228 |
229 // End to end test that verifies that fileBrowserHandler.selectFile works as | 229 // End to end test that verifies that fileBrowserHandler.selectFile works as |
230 // expected. It will run test extension under | 230 // expected. It will run test extension under |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 select_file_function.get(), | 352 select_file_function.get(), |
353 "[{\"suggestedName\": \"/path_to_file/some_file_name.txt\"}]", | 353 "[{\"suggestedName\": \"/path_to_file/some_file_name.txt\"}]", |
354 browser()))); | 354 browser()))); |
355 | 355 |
356 EXPECT_FALSE(utils::GetBoolean(result.get(), "success")); | 356 EXPECT_FALSE(utils::GetBoolean(result.get(), "success")); |
357 DictionaryValue* entry_info; | 357 DictionaryValue* entry_info; |
358 EXPECT_FALSE(result->GetDictionary("entry", &entry_info)); | 358 EXPECT_FALSE(result->GetDictionary("entry", &entry_info)); |
359 } | 359 } |
360 | 360 |
361 } // namespace | 361 } // namespace |
OLD | NEW |