| 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 <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 TaskDescriptor task; | 160 TaskDescriptor task; |
| 161 EXPECT_FALSE(ParseTaskID("invalid", &task)); | 161 EXPECT_FALSE(ParseTaskID("invalid", &task)); |
| 162 } | 162 } |
| 163 | 163 |
| 164 TEST(FileManagerFileTasksTest, ParseTaskID_UnknownTaskType) { | 164 TEST(FileManagerFileTasksTest, ParseTaskID_UnknownTaskType) { |
| 165 TaskDescriptor task; | 165 TaskDescriptor task; |
| 166 EXPECT_FALSE(ParseTaskID("app-id|unknown|action-id", &task)); | 166 EXPECT_FALSE(ParseTaskID("app-id|unknown|action-id", &task)); |
| 167 } | 167 } |
| 168 | 168 |
| 169 TEST(FileManagerFileTasksTest, FindDriveAppTasks) { | 169 TEST(FileManagerFileTasksTest, FindDriveAppTasks) { |
| 170 // For DriveAppRegistry and TestingProfile, which check |
| 171 // CurrentlyOn(BrowserThread::UI). |
| 172 content::TestBrowserThreadBundle thread_bundle; |
| 173 |
| 170 TestingProfile profile; | 174 TestingProfile profile; |
| 171 // For DriveAppRegistry, which checks CurrentlyOn(BrowserThread::UI). | |
| 172 content::TestBrowserThreadBundle thread_bundle; | |
| 173 | 175 |
| 174 // Foo.app can handle "text/plain" and "text/html" | 176 // Foo.app can handle "text/plain" and "text/html" |
| 175 std::unique_ptr<google_apis::AppResource> foo_app( | 177 std::unique_ptr<google_apis::AppResource> foo_app( |
| 176 new google_apis::AppResource); | 178 new google_apis::AppResource); |
| 177 foo_app->set_product_id("foo_app_id"); | 179 foo_app->set_product_id("foo_app_id"); |
| 178 foo_app->set_application_id("foo_app_id"); | 180 foo_app->set_application_id("foo_app_id"); |
| 179 foo_app->set_name("Foo"); | 181 foo_app->set_name("Foo"); |
| 180 foo_app->set_object_type("foo_object_type"); | 182 foo_app->set_object_type("foo_object_type"); |
| 181 ScopedVector<std::string> foo_mime_types; | 183 ScopedVector<std::string> foo_mime_types; |
| 182 foo_mime_types.push_back(new std::string("text/plain")); | 184 foo_mime_types.push_back(new std::string("text/plain")); |
| (...skipping 993 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1176 FindFileHandlerTasks(&test_profile_, entries, &tasks); | 1178 FindFileHandlerTasks(&test_profile_, entries, &tasks); |
| 1177 | 1179 |
| 1178 ASSERT_EQ(1U, tasks.size()); | 1180 ASSERT_EQ(1U, tasks.size()); |
| 1179 EXPECT_EQ(kFooId, tasks[0].task_descriptor().app_id); | 1181 EXPECT_EQ(kFooId, tasks[0].task_descriptor().app_id); |
| 1180 EXPECT_EQ("Foo", tasks[0].task_title()); | 1182 EXPECT_EQ("Foo", tasks[0].task_title()); |
| 1181 EXPECT_EQ(Verb::VERB_PACK_WITH, tasks[0].task_verb()); | 1183 EXPECT_EQ(Verb::VERB_PACK_WITH, tasks[0].task_verb()); |
| 1182 } | 1184 } |
| 1183 | 1185 |
| 1184 } // namespace file_tasks | 1186 } // namespace file_tasks |
| 1185 } // namespace file_manager. | 1187 } // namespace file_manager. |
| OLD | NEW |