OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/apps/drive/drive_app_provider.h" | 5 #include "chrome/browser/apps/drive/drive_app_provider.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 fake_drive_service_.reset(new drive::FakeDriveService); | 104 fake_drive_service_.reset(new drive::FakeDriveService); |
105 fake_drive_service_->LoadAppListForDriveApi("drive/applist_empty.json"); | 105 fake_drive_service_->LoadAppListForDriveApi("drive/applist_empty.json"); |
106 apps_registry_.reset( | 106 apps_registry_.reset( |
107 new drive::DriveAppRegistry(fake_drive_service_.get())); | 107 new drive::DriveAppRegistry(fake_drive_service_.get())); |
108 | 108 |
109 fake_uninstall_sync_service_.reset(new FakeUninstallSyncService); | 109 fake_uninstall_sync_service_.reset(new FakeUninstallSyncService); |
110 | 110 |
111 provider_.reset( | 111 provider_.reset( |
112 new DriveAppProvider(profile(), fake_uninstall_sync_service_.get())); | 112 new DriveAppProvider(profile(), fake_uninstall_sync_service_.get())); |
113 provider_->SetDriveServiceBridgeForTest( | 113 provider_->SetDriveServiceBridgeForTest( |
114 make_scoped_ptr(new TestDriveServiceBridge(apps_registry_.get())) | 114 make_scoped_ptr(new TestDriveServiceBridge(apps_registry_.get()))); |
115 .PassAs<DriveServiceBridge>()); | |
116 | 115 |
117 // The DriveAppProvider in AppListSyncalbeService interferes with the | 116 // The DriveAppProvider in AppListSyncalbeService interferes with the |
118 // test. So resets it. | 117 // test. So resets it. |
119 app_list::AppListSyncableServiceFactory::GetForProfile(profile()) | 118 app_list::AppListSyncableServiceFactory::GetForProfile(profile()) |
120 ->ResetDriveAppProviderForTest(); | 119 ->ResetDriveAppProviderForTest(); |
121 } | 120 } |
122 | 121 |
123 virtual void TearDownOnMainThread() override { | 122 virtual void TearDownOnMainThread() override { |
124 provider_.reset(); | 123 provider_.reset(); |
125 apps_registry_.reset(); | 124 apps_registry_.reset(); |
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
579 chrome_app_id, ExtensionRegistry::EVERYTHING)); | 578 chrome_app_id, ExtensionRegistry::EVERYTHING)); |
580 | 579 |
581 // Uninstall is removed from sync and the app is added again. | 580 // Uninstall is removed from sync and the app is added again. |
582 provider()->RemoveUninstalledDriveAppFromSync(kDriveAppId); | 581 provider()->RemoveUninstalledDriveAppFromSync(kDriveAppId); |
583 WaitForPendingDriveAppConverters(); | 582 WaitForPendingDriveAppConverters(); |
584 chrome_app_id = mapping()->GetChromeApp(kDriveAppId); | 583 chrome_app_id = mapping()->GetChromeApp(kDriveAppId); |
585 EXPECT_FALSE(chrome_app_id.empty()); | 584 EXPECT_FALSE(chrome_app_id.empty()); |
586 EXPECT_TRUE(ExtensionRegistry::Get(profile())->GetExtensionById( | 585 EXPECT_TRUE(ExtensionRegistry::Get(profile())->GetExtensionById( |
587 chrome_app_id, ExtensionRegistry::EVERYTHING)); | 586 chrome_app_id, ExtensionRegistry::EVERYTHING)); |
588 } | 587 } |
OLD | NEW |