| 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/extensions/external_provider_impl.h" | 5 #include "chrome/browser/extensions/external_provider_impl.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/prefs/testing_pref_service.h" | 9 #include "base/prefs/testing_pref_service.h" |
| 10 #include "base/test/scoped_path_override.h" | 10 #include "base/test/scoped_path_override.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 }; | 92 }; |
| 93 | 93 |
| 94 } // namespace | 94 } // namespace |
| 95 | 95 |
| 96 // Normal mode, external app should be installed. | 96 // Normal mode, external app should be installed. |
| 97 TEST_F(ExternalProviderImplChromeOSTest, Normal) { | 97 TEST_F(ExternalProviderImplChromeOSTest, Normal) { |
| 98 InitServiceWithExternalProviders(); | 98 InitServiceWithExternalProviders(); |
| 99 | 99 |
| 100 service_->CheckForExternalUpdates(); | 100 service_->CheckForExternalUpdates(); |
| 101 content::WindowedNotificationObserver( | 101 content::WindowedNotificationObserver( |
| 102 chrome::NOTIFICATION_CRX_INSTALLER_DONE, | 102 extensions::NOTIFICATION_CRX_INSTALLER_DONE, |
| 103 content::NotificationService::AllSources()).Wait(); | 103 content::NotificationService::AllSources()).Wait(); |
| 104 | 104 |
| 105 EXPECT_TRUE(service_->GetInstalledExtension(kExternalAppId)); | 105 EXPECT_TRUE(service_->GetInstalledExtension(kExternalAppId)); |
| 106 } | 106 } |
| 107 | 107 |
| 108 // App mode, no external app should be installed. | 108 // App mode, no external app should be installed. |
| 109 TEST_F(ExternalProviderImplChromeOSTest, AppMode) { | 109 TEST_F(ExternalProviderImplChromeOSTest, AppMode) { |
| 110 CommandLine* command = CommandLine::ForCurrentProcess(); | 110 CommandLine* command = CommandLine::ForCurrentProcess(); |
| 111 command->AppendSwitchASCII(switches::kForceAppMode, std::string()); | 111 command->AppendSwitchASCII(switches::kForceAppMode, std::string()); |
| 112 command->AppendSwitchASCII(switches::kAppId, std::string("app_id")); | 112 command->AppendSwitchASCII(switches::kAppId, std::string("app_id")); |
| 113 | 113 |
| 114 InitServiceWithExternalProviders(); | 114 InitServiceWithExternalProviders(); |
| 115 | 115 |
| 116 service_->CheckForExternalUpdates(); | 116 service_->CheckForExternalUpdates(); |
| 117 base::RunLoop().RunUntilIdle(); | 117 base::RunLoop().RunUntilIdle(); |
| 118 | 118 |
| 119 EXPECT_FALSE(service_->GetInstalledExtension(kExternalAppId)); | 119 EXPECT_FALSE(service_->GetInstalledExtension(kExternalAppId)); |
| 120 } | 120 } |
| 121 | 121 |
| 122 } // namespace extensions | 122 } // namespace extensions |
| OLD | NEW |