| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/chromeos/file_manager/file_tasks.h" | 5 #include "chrome/browser/chromeos/file_manager/file_tasks.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 | 95 |
| 96 TEST(FileManagerFileTasksTest, MakeTaskID) { | 96 TEST(FileManagerFileTasksTest, MakeTaskID) { |
| 97 EXPECT_EQ("app-id|file|action-id", | 97 EXPECT_EQ("app-id|file|action-id", |
| 98 MakeTaskID("app-id", TASK_TYPE_FILE_BROWSER_HANDLER, "action-id")); | 98 MakeTaskID("app-id", TASK_TYPE_FILE_BROWSER_HANDLER, "action-id")); |
| 99 EXPECT_EQ("app-id|app|action-id", | 99 EXPECT_EQ("app-id|app|action-id", |
| 100 MakeTaskID("app-id", TASK_TYPE_FILE_HANDLER, "action-id")); | 100 MakeTaskID("app-id", TASK_TYPE_FILE_HANDLER, "action-id")); |
| 101 EXPECT_EQ("app-id|drive|action-id", | 101 EXPECT_EQ("app-id|drive|action-id", |
| 102 MakeTaskID("app-id", TASK_TYPE_DRIVE_APP, "action-id")); | 102 MakeTaskID("app-id", TASK_TYPE_DRIVE_APP, "action-id")); |
| 103 } | 103 } |
| 104 | 104 |
| 105 TEST(FileManagerFileTasksTest, MakeDriveAppTaskId) { | |
| 106 EXPECT_EQ("app-id|drive|open-with", MakeDriveAppTaskId("app-id")); | |
| 107 } | |
| 108 | |
| 109 TEST(FileManagerFileTasksTest, TaskDescriptorToId) { | 105 TEST(FileManagerFileTasksTest, TaskDescriptorToId) { |
| 110 EXPECT_EQ("app-id|file|action-id", | 106 EXPECT_EQ("app-id|file|action-id", |
| 111 TaskDescriptorToId(TaskDescriptor("app-id", | 107 TaskDescriptorToId(TaskDescriptor("app-id", |
| 112 TASK_TYPE_FILE_BROWSER_HANDLER, | 108 TASK_TYPE_FILE_BROWSER_HANDLER, |
| 113 "action-id"))); | 109 "action-id"))); |
| 114 } | 110 } |
| 115 | 111 |
| 116 TEST(FileManagerFileTasksTest, ParseTaskID_FileBrowserHandler) { | 112 TEST(FileManagerFileTasksTest, ParseTaskID_FileBrowserHandler) { |
| 117 TaskDescriptor task; | 113 TaskDescriptor task; |
| 118 EXPECT_TRUE(ParseTaskID("app-id|file|action-id", &task)); | 114 EXPECT_TRUE(ParseTaskID("app-id|file|action-id", &task)); |
| (...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 793 &drive_app_registry, | 789 &drive_app_registry, |
| 794 path_mime_set, | 790 path_mime_set, |
| 795 file_urls, | 791 file_urls, |
| 796 &tasks); | 792 &tasks); |
| 797 ASSERT_EQ(1U, tasks.size()); | 793 ASSERT_EQ(1U, tasks.size()); |
| 798 EXPECT_EQ(kFileManagerAppId, tasks[0].task_descriptor().app_id); | 794 EXPECT_EQ(kFileManagerAppId, tasks[0].task_descriptor().app_id); |
| 799 } | 795 } |
| 800 | 796 |
| 801 } // namespace file_tasks | 797 } // namespace file_tasks |
| 802 } // namespace file_manager. | 798 } // namespace file_manager. |
| OLD | NEW |