| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/extension_service_unittest.h" | 5 #include "chrome/browser/extensions/extension_service_unittest.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 3288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3299 bool ready_; | 3299 bool ready_; |
| 3300 }; | 3300 }; |
| 3301 | 3301 |
| 3302 // Test that we get enabled/disabled correctly for all the pref/command-line | 3302 // Test that we get enabled/disabled correctly for all the pref/command-line |
| 3303 // combinations. We don't want to derive from the ExtensionServiceTest class | 3303 // combinations. We don't want to derive from the ExtensionServiceTest class |
| 3304 // for this test, so we use ExtensionServiceTestSimple. | 3304 // for this test, so we use ExtensionServiceTestSimple. |
| 3305 // | 3305 // |
| 3306 // Also tests that we always fire EXTENSIONS_READY, no matter whether we are | 3306 // Also tests that we always fire EXTENSIONS_READY, no matter whether we are |
| 3307 // enabled or not. | 3307 // enabled or not. |
| 3308 TEST(ExtensionServiceTestSimple, Enabledness) { | 3308 TEST(ExtensionServiceTestSimple, Enabledness) { |
| 3309 ScopedTestingBrowserProcess browser_process; | |
| 3310 | |
| 3311 ExtensionErrorReporter::Init(false); // no noisy errors | 3309 ExtensionErrorReporter::Init(false); // no noisy errors |
| 3312 ExtensionsReadyRecorder recorder; | 3310 ExtensionsReadyRecorder recorder; |
| 3313 scoped_ptr<TestingProfile> profile(new TestingProfile()); | 3311 scoped_ptr<TestingProfile> profile(new TestingProfile()); |
| 3314 MessageLoop loop; | 3312 MessageLoop loop; |
| 3315 BrowserThread ui_thread(BrowserThread::UI, &loop); | 3313 BrowserThread ui_thread(BrowserThread::UI, &loop); |
| 3316 BrowserThread file_thread(BrowserThread::FILE, &loop); | 3314 BrowserThread file_thread(BrowserThread::FILE, &loop); |
| 3317 scoped_ptr<CommandLine> command_line; | 3315 scoped_ptr<CommandLine> command_line; |
| 3318 FilePath install_dir = profile->GetPath() | 3316 FilePath install_dir = profile->GetPath() |
| 3319 .AppendASCII(ExtensionService::kInstallDirectoryName); | 3317 .AppendASCII(ExtensionService::kInstallDirectoryName); |
| 3320 | 3318 |
| (...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3965 ASSERT_FALSE(AddPendingSyncInstall()); | 3963 ASSERT_FALSE(AddPendingSyncInstall()); |
| 3966 | 3964 |
| 3967 // Wait for the external source to install. | 3965 // Wait for the external source to install. |
| 3968 WaitForCrxInstall(crx_path_, true); | 3966 WaitForCrxInstall(crx_path_, true); |
| 3969 ASSERT_TRUE(IsCrxInstalled()); | 3967 ASSERT_TRUE(IsCrxInstalled()); |
| 3970 | 3968 |
| 3971 // Now that the extension is installed, sync request should fail | 3969 // Now that the extension is installed, sync request should fail |
| 3972 // because the extension is already installed. | 3970 // because the extension is already installed. |
| 3973 ASSERT_FALSE(AddPendingSyncInstall()); | 3971 ASSERT_FALSE(AddPendingSyncInstall()); |
| 3974 } | 3972 } |
| OLD | NEW |