OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/chromeos/file_system_provider/operations/configure.h" | 5 #include "chrome/browser/chromeos/file_system_provider/operations/configure.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/files/file.h" | 10 #include "base/files/file.h" |
11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "chrome/browser/chromeos/file_system_provider/operations/test_util.h" | 13 #include "chrome/browser/chromeos/file_system_provider/operations/test_util.h" |
14 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_inte
rface.h" | 14 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_inte
rface.h" |
15 #include "chrome/common/extensions/api/file_system_provider.h" | 15 #include "chrome/common/extensions/api/file_system_provider.h" |
| 16 #include "chrome/common/extensions/api/file_system_provider_capabilities/file_sy
stem_provider_capabilities_handler.h" |
16 #include "chrome/common/extensions/api/file_system_provider_internal.h" | 17 #include "chrome/common/extensions/api/file_system_provider_internal.h" |
17 #include "extensions/browser/event_router.h" | 18 #include "extensions/browser/event_router.h" |
18 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
19 | 20 |
20 namespace chromeos { | 21 namespace chromeos { |
21 namespace file_system_provider { | 22 namespace file_system_provider { |
22 namespace operations { | 23 namespace operations { |
23 namespace { | 24 namespace { |
24 | 25 |
25 const char kExtensionId[] = "mbflcebpggnecokmikipoihdbecnjfoj"; | 26 const char kExtensionId[] = "mbflcebpggnecokmikipoihdbecnjfoj"; |
26 const char kFileSystemId[] = "testing-file-system"; | 27 const char kFileSystemId[] = "testing-file-system"; |
27 const int kRequestId = 2; | 28 const int kRequestId = 2; |
28 | 29 |
29 } // namespace | 30 } // namespace |
30 | 31 |
31 class FileSystemProviderOperationsConfigureTest : public testing::Test { | 32 class FileSystemProviderOperationsConfigureTest : public testing::Test { |
32 protected: | 33 protected: |
33 FileSystemProviderOperationsConfigureTest() {} | 34 FileSystemProviderOperationsConfigureTest() {} |
34 ~FileSystemProviderOperationsConfigureTest() override {} | 35 ~FileSystemProviderOperationsConfigureTest() override {} |
35 | 36 |
36 void SetUp() override { | 37 void SetUp() override { |
37 file_system_info_ = ProvidedFileSystemInfo( | 38 file_system_info_ = ProvidedFileSystemInfo( |
38 kExtensionId, MountOptions(kFileSystemId, "" /* display_name */), | 39 kExtensionId, MountOptions(kFileSystemId, "" /* display_name */), |
39 base::FilePath()); | 40 base::FilePath(), false /* configurable */, extensions::SOURCE_FILE); |
40 } | 41 } |
41 | 42 |
42 ProvidedFileSystemInfo file_system_info_; | 43 ProvidedFileSystemInfo file_system_info_; |
43 }; | 44 }; |
44 | 45 |
45 TEST_F(FileSystemProviderOperationsConfigureTest, Execute) { | 46 TEST_F(FileSystemProviderOperationsConfigureTest, Execute) { |
46 using extensions::api::file_system_provider::ConfigureRequestedOptions; | 47 using extensions::api::file_system_provider::ConfigureRequestedOptions; |
47 | 48 |
48 util::LoggingDispatchEventImpl dispatcher(true /* dispatch_reply */); | 49 util::LoggingDispatchEventImpl dispatcher(true /* dispatch_reply */); |
49 util::StatusCallbackLog callback_log; | 50 util::StatusCallbackLog callback_log; |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 configure.OnError(kRequestId, scoped_ptr<RequestValue>(new RequestValue()), | 121 configure.OnError(kRequestId, scoped_ptr<RequestValue>(new RequestValue()), |
121 base::File::FILE_ERROR_NOT_FOUND); | 122 base::File::FILE_ERROR_NOT_FOUND); |
122 ASSERT_EQ(1u, callback_log.size()); | 123 ASSERT_EQ(1u, callback_log.size()); |
123 base::File::Error event_result = callback_log[0]; | 124 base::File::Error event_result = callback_log[0]; |
124 EXPECT_EQ(base::File::FILE_ERROR_NOT_FOUND, event_result); | 125 EXPECT_EQ(base::File::FILE_ERROR_NOT_FOUND, event_result); |
125 } | 126 } |
126 | 127 |
127 } // namespace operations | 128 } // namespace operations |
128 } // namespace file_system_provider | 129 } // namespace file_system_provider |
129 } // namespace chromeos | 130 } // namespace chromeos |
OLD | NEW |