| Index: chrome/browser/chromeos/file_system_provider/operations/truncate_unittest.cc
|
| diff --git a/chrome/browser/chromeos/file_system_provider/operations/truncate_unittest.cc b/chrome/browser/chromeos/file_system_provider/operations/truncate_unittest.cc
|
| index 1ba6a14c29f743934b8957fc66f7c6411113fcf4..c2943e9b77ff91b697b0064ab42eb7006f2f6b67 100644
|
| --- a/chrome/browser/chromeos/file_system_provider/operations/truncate_unittest.cc
|
| +++ b/chrome/browser/chromeos/file_system_provider/operations/truncate_unittest.cc
|
| @@ -50,6 +50,8 @@ class FileSystemProviderOperationsTruncateTest : public testing::Test {
|
| };
|
|
|
| TEST_F(FileSystemProviderOperationsTruncateTest, Execute) {
|
| + using extensions::api::file_system_provider::TruncateRequestedOptions;
|
| +
|
| util::LoggingDispatchEventImpl dispatcher(true /* dispatch_reply */);
|
| util::StatusCallbackLog callback_log;
|
|
|
| @@ -72,24 +74,15 @@ TEST_F(FileSystemProviderOperationsTruncateTest, 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);
|
| -
|
| - std::string event_file_path;
|
| - EXPECT_TRUE(options->GetString("filePath", &event_file_path));
|
| - EXPECT_EQ(kFilePath, event_file_path);
|
| + const base::DictionaryValue* options_as_value = NULL;
|
| + ASSERT_TRUE(event_args->GetDictionary(0, &options_as_value));
|
|
|
| - double event_length = -1;
|
| - EXPECT_TRUE(options->GetDouble("length", &event_length));
|
| - EXPECT_EQ(kTruncateLength, static_cast<double>(event_length));
|
| + TruncateRequestedOptions options;
|
| + ASSERT_TRUE(TruncateRequestedOptions::Populate(*options_as_value, &options));
|
| + EXPECT_EQ(kFileSystemId, options.file_system_id);
|
| + EXPECT_EQ(kRequestId, options.request_id);
|
| + EXPECT_EQ(kFilePath, options.file_path);
|
| + EXPECT_EQ(kTruncateLength, static_cast<double>(options.length));
|
| }
|
|
|
| TEST_F(FileSystemProviderOperationsTruncateTest, Execute_NoListener) {
|
|
|