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

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

Issue 1239043002: Add support for actions for multiple file selection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Better documentation. Created 5 years, 5 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/execute_action_unittest.cc
diff --git a/chrome/browser/chromeos/file_system_provider/operations/execute_action_unittest.cc b/chrome/browser/chromeos/file_system_provider/operations/execute_action_unittest.cc
index f89c4d274f4d1cefbcf7b202171cdb9c75621749..de14bd4445a140fd3b3781721d9ac2eab32d58d1 100644
--- a/chrome/browser/chromeos/file_system_provider/operations/execute_action_unittest.cc
+++ b/chrome/browser/chromeos/file_system_provider/operations/execute_action_unittest.cc
@@ -28,8 +28,10 @@ namespace {
const char kExtensionId[] = "mbflcebpggnecokmikipoihdbecnjfoj";
const char kFileSystemId[] = "testing-file-system";
const int kRequestId = 2;
-const base::FilePath::CharType kEntryPath[] =
+const base::FilePath::CharType kDirectoryPath[] =
FILE_PATH_LITERAL("/kitty/and/puppy/happy");
+const base::FilePath::CharType kFilePath[] =
+ FILE_PATH_LITERAL("/rabbit/and/bear/happy");
const char kActionId[] = "SHARE";
} // namespace
@@ -44,9 +46,13 @@ class FileSystemProviderOperationsExecuteActionTest : public testing::Test {
kExtensionId, MountOptions(kFileSystemId, "" /* display_name */),
base::FilePath(), false /* configurable */, true /* watchable */,
extensions::SOURCE_FILE);
+ entry_paths_.clear();
+ entry_paths_.insert(base::FilePath(kDirectoryPath));
+ entry_paths_.insert(base::FilePath(kFilePath));
}
ProvidedFileSystemInfo file_system_info_;
+ std::set<base::FilePath> entry_paths_;
};
TEST_F(FileSystemProviderOperationsExecuteActionTest, Execute) {
@@ -56,7 +62,7 @@ TEST_F(FileSystemProviderOperationsExecuteActionTest, Execute) {
util::StatusCallbackLog callback_log;
ExecuteAction execute_action(
- NULL, file_system_info_, base::FilePath(kEntryPath), kActionId,
+ NULL, file_system_info_, entry_paths_, kActionId,
base::Bind(&util::LogStatusCallback, &callback_log));
execute_action.SetDispatchEventImplForTesting(
base::Bind(&util::LoggingDispatchEventImpl::OnDispatchEventImpl,
@@ -80,7 +86,9 @@ TEST_F(FileSystemProviderOperationsExecuteActionTest, Execute) {
ExecuteActionRequestedOptions::Populate(*options_as_value, &options));
EXPECT_EQ(kFileSystemId, options.file_system_id);
EXPECT_EQ(kRequestId, options.request_id);
- EXPECT_EQ(kEntryPath, options.entry_path);
+ ASSERT_EQ(entry_paths_.size(), options.entry_paths.size());
+ EXPECT_EQ(1u, entry_paths_.count(base::FilePath(options.entry_paths[0])));
+ EXPECT_EQ(1u, entry_paths_.count(base::FilePath(options.entry_paths[1])));
EXPECT_EQ(kActionId, options.action_id);
}
@@ -89,7 +97,7 @@ TEST_F(FileSystemProviderOperationsExecuteActionTest, Execute_NoListener) {
util::StatusCallbackLog callback_log;
ExecuteAction execute_action(
- NULL, file_system_info_, base::FilePath(kEntryPath), kActionId,
+ NULL, file_system_info_, entry_paths_, kActionId,
base::Bind(&util::LogStatusCallback, &callback_log));
execute_action.SetDispatchEventImplForTesting(
base::Bind(&util::LoggingDispatchEventImpl::OnDispatchEventImpl,
@@ -103,7 +111,7 @@ TEST_F(FileSystemProviderOperationsExecuteActionTest, OnSuccess) {
util::StatusCallbackLog callback_log;
ExecuteAction execute_action(
- NULL, file_system_info_, base::FilePath(kEntryPath), kActionId,
+ NULL, file_system_info_, entry_paths_, kActionId,
base::Bind(&util::LogStatusCallback, &callback_log));
execute_action.SetDispatchEventImplForTesting(
base::Bind(&util::LoggingDispatchEventImpl::OnDispatchEventImpl,
@@ -123,7 +131,7 @@ TEST_F(FileSystemProviderOperationsExecuteActionTest, OnError) {
util::StatusCallbackLog callback_log;
ExecuteAction execute_action(
- NULL, file_system_info_, base::FilePath(kEntryPath), kActionId,
+ NULL, file_system_info_, entry_paths_, kActionId,
base::Bind(&util::LogStatusCallback, &callback_log));
execute_action.SetDispatchEventImplForTesting(
base::Bind(&util::LoggingDispatchEventImpl::OnDispatchEventImpl,

Powered by Google App Engine
This is Rietveld 408576698