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 #include "chrome/browser/chromeos/file_system_provider/operations/read_file.h" | 5 #include "chrome/browser/chromeos/file_system_provider/operations/read_file.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 EXPECT_TRUE(read_file.Execute(kRequestId)); | 171 EXPECT_TRUE(read_file.Execute(kRequestId)); |
172 | 172 |
173 const std::string data = "ABCDE"; | 173 const std::string data = "ABCDE"; |
174 const bool has_more = false; | 174 const bool has_more = false; |
175 const int execution_time = 0; | 175 const int execution_time = 0; |
176 | 176 |
177 base::ListValue value_as_list; | 177 base::ListValue value_as_list; |
178 value_as_list.Set(0, base::MakeUnique<base::Value>(kFileSystemId)); | 178 value_as_list.Set(0, base::MakeUnique<base::Value>(kFileSystemId)); |
179 value_as_list.Set(1, base::MakeUnique<base::Value>(kRequestId)); | 179 value_as_list.Set(1, base::MakeUnique<base::Value>(kRequestId)); |
180 value_as_list.Set( | 180 value_as_list.Set( |
181 2, base::BinaryValue::CreateWithCopiedBuffer(data.c_str(), data.size())); | 181 2, base::Value::CreateWithCopiedBuffer(data.c_str(), data.size())); |
182 value_as_list.Set(3, base::MakeUnique<base::Value>(has_more)); | 182 value_as_list.Set(3, base::MakeUnique<base::Value>(has_more)); |
183 value_as_list.Set(4, base::MakeUnique<base::Value>(execution_time)); | 183 value_as_list.Set(4, base::MakeUnique<base::Value>(execution_time)); |
184 | 184 |
185 std::unique_ptr<Params> params(Params::Create(value_as_list)); | 185 std::unique_ptr<Params> params(Params::Create(value_as_list)); |
186 ASSERT_TRUE(params.get()); | 186 ASSERT_TRUE(params.get()); |
187 std::unique_ptr<RequestValue> request_value( | 187 std::unique_ptr<RequestValue> request_value( |
188 RequestValue::CreateForReadFileSuccess(std::move(params))); | 188 RequestValue::CreateForReadFileSuccess(std::move(params))); |
189 ASSERT_TRUE(request_value.get()); | 189 ASSERT_TRUE(request_value.get()); |
190 | 190 |
191 read_file.OnSuccess(kRequestId, std::move(request_value), has_more); | 191 read_file.OnSuccess(kRequestId, std::move(request_value), has_more); |
(...skipping 29 matching lines...) Expand all Loading... |
221 base::File::FILE_ERROR_TOO_MANY_OPENED); | 221 base::File::FILE_ERROR_TOO_MANY_OPENED); |
222 | 222 |
223 ASSERT_EQ(1u, callback_logger.events().size()); | 223 ASSERT_EQ(1u, callback_logger.events().size()); |
224 CallbackLogger::Event* event = callback_logger.events()[0].get(); | 224 CallbackLogger::Event* event = callback_logger.events()[0].get(); |
225 EXPECT_EQ(base::File::FILE_ERROR_TOO_MANY_OPENED, event->result()); | 225 EXPECT_EQ(base::File::FILE_ERROR_TOO_MANY_OPENED, event->result()); |
226 } | 226 } |
227 | 227 |
228 } // namespace operations | 228 } // namespace operations |
229 } // namespace file_system_provider | 229 } // namespace file_system_provider |
230 } // namespace chromeos | 230 } // namespace chromeos |
OLD | NEW |