| 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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 base::Unretained(&dispatcher))); | 169 base::Unretained(&dispatcher))); |
| 170 | 170 |
| 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, new base::StringValue(kFileSystemId)); | 178 value_as_list.Set(0, new base::StringValue(kFileSystemId)); |
| 179 value_as_list.Set(1, new base::FundamentalValue(kRequestId)); | 179 value_as_list.Set(1, new 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::BinaryValue::CreateWithCopiedBuffer(data.c_str(), data.size())); |
| 182 value_as_list.Set(3, new base::FundamentalValue(has_more)); | 182 value_as_list.Set(3, new base::Value(has_more)); |
| 183 value_as_list.Set(4, new base::FundamentalValue(execution_time)); | 183 value_as_list.Set(4, new 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); |
| 192 | 192 |
| 193 ASSERT_EQ(1u, callback_logger.events().size()); | 193 ASSERT_EQ(1u, callback_logger.events().size()); |
| (...skipping 27 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]; | 224 CallbackLogger::Event* event = callback_logger.events()[0]; |
| 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 |