| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/drive/drive_app_registry.h" | 5 #include "chrome/browser/chromeos/drive/drive_app_registry.h" |
| 6 | 6 |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/json/json_file_value_serializer.h" | 8 #include "base/json/json_file_value_serializer.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 is_primary); | 79 is_primary); |
| 80 } | 80 } |
| 81 | 81 |
| 82 bool VerifyApp2(const ScopedVector<DriveAppInfo>& list, | 82 bool VerifyApp2(const ScopedVector<DriveAppInfo>& list, |
| 83 bool is_primary) { | 83 bool is_primary) { |
| 84 return VerifyApp(list, "deadbeefdeadbeef", "22222222", | 84 return VerifyApp(list, "deadbeefdeadbeef", "22222222", |
| 85 "Drive App 2", "Drive App Object 2", | 85 "Drive App 2", "Drive App Object 2", |
| 86 is_primary); | 86 is_primary); |
| 87 } | 87 } |
| 88 | 88 |
| 89 MessageLoopForUI message_loop_; | 89 base::MessageLoopForUI message_loop_; |
| 90 content::TestBrowserThread ui_thread_; | 90 content::TestBrowserThread ui_thread_; |
| 91 | 91 |
| 92 scoped_ptr<TestingProfile> profile_; | 92 scoped_ptr<TestingProfile> profile_; |
| 93 scoped_ptr<google_apis::FakeDriveService> fake_drive_service_; | 93 scoped_ptr<google_apis::FakeDriveService> fake_drive_service_; |
| 94 scoped_ptr<JobScheduler> scheduler_; | 94 scoped_ptr<JobScheduler> scheduler_; |
| 95 scoped_ptr<DriveAppRegistry> web_apps_registry_; | 95 scoped_ptr<DriveAppRegistry> web_apps_registry_; |
| 96 }; | 96 }; |
| 97 | 97 |
| 98 TEST_F(DriveAppRegistryTest, LoadAndFindDriveApps) { | 98 TEST_F(DriveAppRegistryTest, LoadAndFindDriveApps) { |
| 99 // Find by primary extension 'exe'. | 99 // Find by primary extension 'exe'. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 115 // Find by secondary MIME type. | 115 // Find by secondary MIME type. |
| 116 ScopedVector<DriveAppInfo> secondary_app; | 116 ScopedVector<DriveAppInfo> secondary_app; |
| 117 web_apps_registry_->GetAppsForFile( | 117 web_apps_registry_->GetAppsForFile( |
| 118 base::FilePath(), "text/html", &secondary_app); | 118 base::FilePath(), "text/html", &secondary_app); |
| 119 ASSERT_EQ(1U, secondary_app.size()); | 119 ASSERT_EQ(1U, secondary_app.size()); |
| 120 VerifyApp(secondary_app, "abcdefghabcdefghabcdefghabcdefgh", "123456788192", | 120 VerifyApp(secondary_app, "abcdefghabcdefghabcdefghabcdefgh", "123456788192", |
| 121 "Drive app 1", "", false); | 121 "Drive app 1", "", false); |
| 122 } | 122 } |
| 123 | 123 |
| 124 } // namespace drive | 124 } // namespace drive |
| OLD | NEW |