| Index: chrome/browser/chromeos/file_system_provider/operations/read_file_unittest.cc
|
| diff --git a/chrome/browser/chromeos/file_system_provider/operations/read_file_unittest.cc b/chrome/browser/chromeos/file_system_provider/operations/read_file_unittest.cc
|
| index d62e3a7f6072bcc4044c82eddd7a320b94b4bb52..7a5b36044eb5941309dde25e9847cad515be532f 100644
|
| --- a/chrome/browser/chromeos/file_system_provider/operations/read_file_unittest.cc
|
| +++ b/chrome/browser/chromeos/file_system_provider/operations/read_file_unittest.cc
|
| @@ -91,6 +91,8 @@ class FileSystemProviderOperationsReadFileTest : public testing::Test {
|
| };
|
|
|
| TEST_F(FileSystemProviderOperationsReadFileTest, Execute) {
|
| + using extensions::api::file_system_provider::ReadFileRequestedOptions;
|
| +
|
| util::LoggingDispatchEventImpl dispatcher(true /* dispatch_reply */);
|
| CallbackLogger callback_logger;
|
|
|
| @@ -116,28 +118,16 @@ TEST_F(FileSystemProviderOperationsReadFileTest, Execute) {
|
| base::ListValue* event_args = event->event_args.get();
|
| ASSERT_EQ(1u, event_args->GetSize());
|
|
|
| - base::DictionaryValue* options = NULL;
|
| - ASSERT_TRUE(event_args->GetDictionary(0, &options));
|
| -
|
| - std::string event_file_system_id;
|
| - EXPECT_TRUE(options->GetString("fileSystemId", &event_file_system_id));
|
| - EXPECT_EQ(kFileSystemId, event_file_system_id);
|
| -
|
| - int event_request_id = -1;
|
| - EXPECT_TRUE(options->GetInteger("requestId", &event_request_id));
|
| - EXPECT_EQ(kRequestId, event_request_id);
|
| -
|
| - int event_file_handle = -1;
|
| - EXPECT_TRUE(options->GetInteger("openRequestId", &event_file_handle));
|
| - EXPECT_EQ(kFileHandle, event_file_handle);
|
| -
|
| - double event_offset = -1;
|
| - EXPECT_TRUE(options->GetDouble("offset", &event_offset));
|
| - EXPECT_EQ(kOffset, static_cast<double>(event_offset));
|
| + const base::DictionaryValue* options_as_value = NULL;
|
| + ASSERT_TRUE(event_args->GetDictionary(0, &options_as_value));
|
|
|
| - int event_length = -1;
|
| - EXPECT_TRUE(options->GetInteger("length", &event_length));
|
| - EXPECT_EQ(kLength, event_length);
|
| + ReadFileRequestedOptions options;
|
| + ASSERT_TRUE(ReadFileRequestedOptions::Populate(*options_as_value, &options));
|
| + EXPECT_EQ(kFileSystemId, options.file_system_id);
|
| + EXPECT_EQ(kRequestId, options.request_id);
|
| + EXPECT_EQ(kFileHandle, options.open_request_id);
|
| + EXPECT_EQ(kOffset, static_cast<double>(options.offset));
|
| + EXPECT_EQ(kLength, options.length);
|
| }
|
|
|
| TEST_F(FileSystemProviderOperationsReadFileTest, Execute_NoListener) {
|
|
|