| 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 <memory> | 7 #include <memory> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 fake_drive_service_.reset(new drive::FakeDriveService); | 101 fake_drive_service_.reset(new drive::FakeDriveService); |
| 102 fake_drive_service_->LoadAppListForDriveApi("drive/applist_empty.json"); | 102 fake_drive_service_->LoadAppListForDriveApi("drive/applist_empty.json"); |
| 103 apps_registry_.reset( | 103 apps_registry_.reset( |
| 104 new drive::DriveAppRegistry(fake_drive_service_.get())); | 104 new drive::DriveAppRegistry(fake_drive_service_.get())); |
| 105 | 105 |
| 106 fake_uninstall_sync_service_.reset(new FakeUninstallSyncService); | 106 fake_uninstall_sync_service_.reset(new FakeUninstallSyncService); |
| 107 | 107 |
| 108 provider_.reset( | 108 provider_.reset( |
| 109 new DriveAppProvider(profile(), fake_uninstall_sync_service_.get())); | 109 new DriveAppProvider(profile(), fake_uninstall_sync_service_.get())); |
| 110 provider_->SetDriveServiceBridgeForTest( | 110 provider_->SetDriveServiceBridgeForTest( |
| 111 base::WrapUnique(new TestDriveServiceBridge(apps_registry_.get()))); | 111 base::MakeUnique<TestDriveServiceBridge>(apps_registry_.get())); |
| 112 | 112 |
| 113 // The DriveAppProvider in AppListSyncalbeService interferes with the | 113 // The DriveAppProvider in AppListSyncalbeService interferes with the |
| 114 // test. So resets it. | 114 // test. So resets it. |
| 115 app_list::AppListSyncableServiceFactory::GetForProfile(profile()) | 115 app_list::AppListSyncableServiceFactory::GetForProfile(profile()) |
| 116 ->ResetDriveAppProviderForTest(); | 116 ->ResetDriveAppProviderForTest(); |
| 117 } | 117 } |
| 118 | 118 |
| 119 void TearDownOnMainThread() override { | 119 void TearDownOnMainThread() override { |
| 120 provider_.reset(); | 120 provider_.reset(); |
| 121 apps_registry_.reset(); | 121 apps_registry_.reset(); |
| (...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 617 kDriveAppId, kDriveAppName, kChromeAppId, kLaunchUrl, true); | 617 kDriveAppId, kDriveAppName, kChromeAppId, kLaunchUrl, true); |
| 618 RefreshDriveAppRegistry(); | 618 RefreshDriveAppRegistry(); |
| 619 WaitForPendingDriveAppConverters(); | 619 WaitForPendingDriveAppConverters(); |
| 620 | 620 |
| 621 // The app should be gone. | 621 // The app should be gone. |
| 622 chrome_app_id = mapping()->GetChromeApp(kDriveAppId); | 622 chrome_app_id = mapping()->GetChromeApp(kDriveAppId); |
| 623 EXPECT_TRUE(chrome_app_id.empty()); | 623 EXPECT_TRUE(chrome_app_id.empty()); |
| 624 EXPECT_FALSE(ExtensionRegistry::Get(profile())->GetExtensionById( | 624 EXPECT_FALSE(ExtensionRegistry::Get(profile())->GetExtensionById( |
| 625 chrome_app_id, ExtensionRegistry::EVERYTHING)); | 625 chrome_app_id, ExtensionRegistry::EVERYTHING)); |
| 626 } | 626 } |
| OLD | NEW |