OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 // TODO(mtomasz): Move these test cases to operations/unmount_unittest.cc. | 5 // TODO(mtomasz): Move these test cases to operations/unmount_unittest.cc. |
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" |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 EXPECT_EQ(kExpectedRequestId, request_id); | 131 EXPECT_EQ(kExpectedRequestId, request_id); |
132 | 132 |
133 // Callback should not be called, yet. | 133 // Callback should not be called, yet. |
134 EXPECT_FALSE(logger.error()); | 134 EXPECT_FALSE(logger.error()); |
135 | 135 |
136 // Simulate sending a success response from the providing extension. | 136 // Simulate sending a success response from the providing extension. |
137 RequestManager* request_manager = provided_file_system_->GetRequestManager(); | 137 RequestManager* request_manager = provided_file_system_->GetRequestManager(); |
138 ASSERT_TRUE(request_manager); | 138 ASSERT_TRUE(request_manager); |
139 scoped_ptr<RequestValue> response; | 139 scoped_ptr<RequestValue> response; |
140 bool reply_result = request_manager->FulfillRequest( | 140 bool reply_result = request_manager->FulfillRequest( |
141 request_id, response.Pass(), false /* has_next */); | 141 request_id, response.Pass(), false /* has_more */); |
142 EXPECT_TRUE(reply_result); | 142 EXPECT_TRUE(reply_result); |
143 | 143 |
144 // Callback should be called. Verify the error code. | 144 // Callback should be called. Verify the error code. |
145 ASSERT_TRUE(logger.error()); | 145 ASSERT_TRUE(logger.error()); |
146 EXPECT_EQ(base::File::FILE_OK, *logger.error()); | 146 EXPECT_EQ(base::File::FILE_OK, *logger.error()); |
147 } | 147 } |
148 | 148 |
149 TEST_F(FileSystemProviderProvidedFileSystemTest, RequestUnmount_Error) { | 149 TEST_F(FileSystemProviderProvidedFileSystemTest, RequestUnmount_Error) { |
150 EventLogger logger; | 150 EventLogger logger; |
151 | 151 |
(...skipping 24 matching lines...) Expand all Loading... |
176 request_id, base::File::FILE_ERROR_NOT_FOUND); | 176 request_id, base::File::FILE_ERROR_NOT_FOUND); |
177 EXPECT_TRUE(reply_result); | 177 EXPECT_TRUE(reply_result); |
178 | 178 |
179 // Callback should be called. Verify the error code. | 179 // Callback should be called. Verify the error code. |
180 ASSERT_TRUE(logger.error()); | 180 ASSERT_TRUE(logger.error()); |
181 EXPECT_EQ(base::File::FILE_ERROR_NOT_FOUND, *logger.error()); | 181 EXPECT_EQ(base::File::FILE_ERROR_NOT_FOUND, *logger.error()); |
182 } | 182 } |
183 | 183 |
184 } // namespace file_system_provider | 184 } // namespace file_system_provider |
185 } // namespace chromeos | 185 } // namespace chromeos |
OLD | NEW |