| 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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 void OnFinishCrxInstall(const std::string& extension_id, | 206 void OnFinishCrxInstall(const std::string& extension_id, |
| 207 bool success) override { | 207 bool success) override { |
| 208 runner_->Quit(); | 208 runner_->Quit(); |
| 209 } | 209 } |
| 210 | 210 |
| 211 scoped_ptr<drive::FakeDriveService> fake_drive_service_; | 211 scoped_ptr<drive::FakeDriveService> fake_drive_service_; |
| 212 scoped_ptr<FakeUninstallSyncService> fake_uninstall_sync_service_; | 212 scoped_ptr<FakeUninstallSyncService> fake_uninstall_sync_service_; |
| 213 scoped_ptr<drive::DriveAppRegistry> apps_registry_; | 213 scoped_ptr<drive::DriveAppRegistry> apps_registry_; |
| 214 scoped_ptr<DriveAppProvider> provider_; | 214 scoped_ptr<DriveAppProvider> provider_; |
| 215 | 215 |
| 216 base::RepeatingTimer<DriveAppProviderTest> | 216 base::RepeatingTimer pending_drive_app_converter_check_timer_; |
| 217 pending_drive_app_converter_check_timer_; | |
| 218 scoped_refptr<content::MessageLoopRunner> runner_; | 217 scoped_refptr<content::MessageLoopRunner> runner_; |
| 219 | 218 |
| 220 DISALLOW_COPY_AND_ASSIGN(DriveAppProviderTest); | 219 DISALLOW_COPY_AND_ASSIGN(DriveAppProviderTest); |
| 221 }; | 220 }; |
| 222 | 221 |
| 223 // A Drive app maps to an existing Chrome app that has a matching id. | 222 // A Drive app maps to an existing Chrome app that has a matching id. |
| 224 // Uninstalling the chrome app would also disconnect the drive app. | 223 // Uninstalling the chrome app would also disconnect the drive app. |
| 225 IN_PROC_BROWSER_TEST_F(DriveAppProviderTest, ExistingChromeApp) { | 224 IN_PROC_BROWSER_TEST_F(DriveAppProviderTest, ExistingChromeApp) { |
| 226 // Prepare an existing chrome app. | 225 // Prepare an existing chrome app. |
| 227 const Extension* chrome_app = InstallChromeApp(1); | 226 const Extension* chrome_app = InstallChromeApp(1); |
| (...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 617 kDriveAppId, kDriveAppName, kChromeAppId, kLaunchUrl, true); | 616 kDriveAppId, kDriveAppName, kChromeAppId, kLaunchUrl, true); |
| 618 RefreshDriveAppRegistry(); | 617 RefreshDriveAppRegistry(); |
| 619 WaitForPendingDriveAppConverters(); | 618 WaitForPendingDriveAppConverters(); |
| 620 | 619 |
| 621 // The app should be gone. | 620 // The app should be gone. |
| 622 chrome_app_id = mapping()->GetChromeApp(kDriveAppId); | 621 chrome_app_id = mapping()->GetChromeApp(kDriveAppId); |
| 623 EXPECT_TRUE(chrome_app_id.empty()); | 622 EXPECT_TRUE(chrome_app_id.empty()); |
| 624 EXPECT_FALSE(ExtensionRegistry::Get(profile())->GetExtensionById( | 623 EXPECT_FALSE(ExtensionRegistry::Get(profile())->GetExtensionById( |
| 625 chrome_app_id, ExtensionRegistry::EVERYTHING)); | 624 chrome_app_id, ExtensionRegistry::EVERYTHING)); |
| 626 } | 625 } |
| OLD | NEW |