Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(99)

Unified Diff: chrome/browser/chromeos/file_system_provider/operations/close_file_unittest.cc

Issue 547313002: [fsp] Use auto generated methods for generating dictionaries. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/file_system_provider/operations/close_file_unittest.cc
diff --git a/chrome/browser/chromeos/file_system_provider/operations/close_file_unittest.cc b/chrome/browser/chromeos/file_system_provider/operations/close_file_unittest.cc
index e9c824f7ced32766a39aed07535041fe47c33418..bb73e065dfa46fef7dc714d643468795e0e93b94 100644
--- a/chrome/browser/chromeos/file_system_provider/operations/close_file_unittest.cc
+++ b/chrome/browser/chromeos/file_system_provider/operations/close_file_unittest.cc
@@ -48,6 +48,8 @@ class FileSystemProviderOperationsCloseFileTest : public testing::Test {
};
TEST_F(FileSystemProviderOperationsCloseFileTest, Execute) {
+ using extensions::api::file_system_provider::CloseFileRequestedOptions;
+
util::LoggingDispatchEventImpl dispatcher(true /* dispatch_reply */);
util::StatusCallbackLog callback_log;
@@ -69,20 +71,14 @@ TEST_F(FileSystemProviderOperationsCloseFileTest, 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);
+ const base::DictionaryValue* options_as_value = NULL;
+ ASSERT_TRUE(event_args->GetDictionary(0, &options_as_value));
- int event_open_request_id = -1;
- EXPECT_TRUE(options->GetInteger("openRequestId", &event_open_request_id));
- EXPECT_EQ(kOpenRequestId, event_open_request_id);
+ CloseFileRequestedOptions options;
+ ASSERT_TRUE(CloseFileRequestedOptions::Populate(*options_as_value, &options));
+ EXPECT_EQ(kFileSystemId, options.file_system_id);
+ EXPECT_EQ(kRequestId, options.request_id);
+ EXPECT_EQ(kOpenRequestId, options.open_request_id);
}
TEST_F(FileSystemProviderOperationsCloseFileTest, Execute_NoListener) {

Powered by Google App Engine
This is Rietveld 408576698