X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fchrome%2Fbrowser%2Fchromeos%2Ffile_system_provider%2Foperations%2Fcreate_file_unittest.cc;h=36a8ac64c44729c72b23457709020439b7e6e549;hb=3545e9f2671f595d2a2f3ee75ca0393b01e35ef6;hp=37f77cbd8c436c16fa54421e91df357289e8bc5a;hpb=7d210d4c7e9ba36e635eabc5b5780495f8a63292;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/chrome/browser/chromeos/file_system_provider/operations/create_file_unittest.cc b/src/chrome/browser/chromeos/file_system_provider/operations/create_file_unittest.cc index 37f77cb..36a8ac6 100644 --- a/src/chrome/browser/chromeos/file_system_provider/operations/create_file_unittest.cc +++ b/src/chrome/browser/chromeos/file_system_provider/operations/create_file_unittest.cc @@ -16,8 +16,8 @@ #include "chrome/common/extensions/api/file_system_provider.h" #include "chrome/common/extensions/api/file_system_provider_internal.h" #include "extensions/browser/event_router.h" +#include "storage/browser/fileapi/async_file_util.h" #include "testing/gtest/include/gtest/gtest.h" -#include "webkit/browser/fileapi/async_file_util.h" namespace chromeos { namespace file_system_provider { @@ -49,6 +49,8 @@ class FileSystemProviderOperationsCreateFileTest : public testing::Test { }; TEST_F(FileSystemProviderOperationsCreateFileTest, Execute) { + using extensions::api::file_system_provider::CreateFileRequestedOptions; + util::LoggingDispatchEventImpl dispatcher(true /* dispatch_reply */); util::StatusCallbackLog callback_log; @@ -70,20 +72,15 @@ TEST_F(FileSystemProviderOperationsCreateFileTest, 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)); - std::string event_file_path; - EXPECT_TRUE(options->GetString("filePath", &event_file_path)); - EXPECT_EQ(kFilePath, event_file_path); + CreateFileRequestedOptions options; + ASSERT_TRUE( + CreateFileRequestedOptions::Populate(*options_as_value, &options)); + EXPECT_EQ(kFileSystemId, options.file_system_id); + EXPECT_EQ(kRequestId, options.request_id); + EXPECT_EQ(kFilePath, options.file_path); } TEST_F(FileSystemProviderOperationsCreateFileTest, Execute_NoListener) {