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

Unified Diff: chrome/browser/chromeos/file_system_provider/operations/get_actions_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/get_actions_unittest.cc
diff --git a/chrome/browser/chromeos/file_system_provider/operations/get_actions_unittest.cc b/chrome/browser/chromeos/file_system_provider/operations/get_actions_unittest.cc
index 1ca010a3981547591be6e6cf2733bfef27dbd48d..af2f850e084e11fd81dd8528e33b0769d0d4bd0a 100644
--- a/chrome/browser/chromeos/file_system_provider/operations/get_actions_unittest.cc
+++ b/chrome/browser/chromeos/file_system_provider/operations/get_actions_unittest.cc
@@ -29,7 +29,9 @@ namespace {
const char kExtensionId[] = "mbflcebpggnecokmikipoihdbecnjfoj";
const char kFileSystemId[] = "testing-file-system";
const int kRequestId = 2;
-const base::FilePath::CharType kEntryPath[] = FILE_PATH_LITERAL("/directory");
+const base::FilePath::CharType kDirectoryPath[] =
+ FILE_PATH_LITERAL("/directory");
+const base::FilePath::CharType kFilePath[] = FILE_PATH_LITERAL("/file");
// Callback invocation logger. Acts as a fileapi end-point.
class CallbackLogger {
@@ -97,9 +99,13 @@ class FileSystemProviderOperationsGetActionsTest : 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(FileSystemProviderOperationsGetActionsTest, Execute) {
@@ -108,7 +114,7 @@ TEST_F(FileSystemProviderOperationsGetActionsTest, Execute) {
util::LoggingDispatchEventImpl dispatcher(true /* dispatch_reply */);
CallbackLogger callback_logger;
- GetActions get_actions(NULL, file_system_info_, base::FilePath(kEntryPath),
+ GetActions get_actions(NULL, file_system_info_, entry_paths_,
base::Bind(&CallbackLogger::OnGetActions,
base::Unretained(&callback_logger)));
get_actions.SetDispatchEventImplForTesting(
@@ -133,14 +139,16 @@ TEST_F(FileSystemProviderOperationsGetActionsTest, Execute) {
GetActionsRequestedOptions::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])));
}
TEST_F(FileSystemProviderOperationsGetActionsTest, Execute_NoListener) {
util::LoggingDispatchEventImpl dispatcher(false /* dispatch_reply */);
CallbackLogger callback_logger;
- GetActions get_actions(NULL, file_system_info_, base::FilePath(kEntryPath),
+ GetActions get_actions(NULL, file_system_info_, entry_paths_,
base::Bind(&CallbackLogger::OnGetActions,
base::Unretained(&callback_logger)));
get_actions.SetDispatchEventImplForTesting(
@@ -154,7 +162,7 @@ TEST_F(FileSystemProviderOperationsGetActionsTest, OnSuccess) {
util::LoggingDispatchEventImpl dispatcher(true /* dispatch_reply */);
CallbackLogger callback_logger;
- GetActions get_actions(NULL, file_system_info_, base::FilePath(kEntryPath),
+ GetActions get_actions(NULL, file_system_info_, entry_paths_,
base::Bind(&CallbackLogger::OnGetActions,
base::Unretained(&callback_logger)));
get_actions.SetDispatchEventImplForTesting(
@@ -213,7 +221,7 @@ TEST_F(FileSystemProviderOperationsGetActionsTest, OnError) {
util::LoggingDispatchEventImpl dispatcher(true /* dispatch_reply */);
CallbackLogger callback_logger;
- GetActions get_actions(NULL, file_system_info_, base::FilePath(kEntryPath),
+ GetActions get_actions(NULL, file_system_info_, entry_paths_,
base::Bind(&CallbackLogger::OnGetActions,
base::Unretained(&callback_logger)));
get_actions.SetDispatchEventImplForTesting(

Powered by Google App Engine
This is Rietveld 408576698