| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // TODO(rickcam): Bug 73183: Add unit tests for image loading | 5 // TODO(rickcam): Bug 73183: Add unit tests for image loading |
| 6 | 6 |
| 7 #include "chrome/browser/background/background_application_list_model.h" | 7 #include "chrome/browser/background/background_application_list_model.h" |
| 8 | 8 |
| 9 #include <stddef.h> | 9 #include <stddef.h> |
| 10 | 10 |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 ASSERT_TRUE(registry()->enabled_extensions().is_empty()); | 285 ASSERT_TRUE(registry()->enabled_extensions().is_empty()); |
| 286 ASSERT_EQ(0U, model()->size()); | 286 ASSERT_EQ(0U, model()->size()); |
| 287 | 287 |
| 288 extensions::TestExtensionRegistryObserver load_observer(registry()); | 288 extensions::TestExtensionRegistryObserver load_observer(registry()); |
| 289 service()->AddExtension(bgapp.get()); | 289 service()->AddExtension(bgapp.get()); |
| 290 load_observer.WaitForExtensionLoaded(); | 290 load_observer.WaitForExtensionLoaded(); |
| 291 ASSERT_EQ(1U, registry()->enabled_extensions().size()); | 291 ASSERT_EQ(1U, registry()->enabled_extensions().size()); |
| 292 ASSERT_EQ(1U, model()->size()); | 292 ASSERT_EQ(1U, model()->size()); |
| 293 | 293 |
| 294 extensions::TestExtensionRegistryObserver unload_observer(registry()); | 294 extensions::TestExtensionRegistryObserver unload_observer(registry()); |
| 295 service()->UnloadExtension( | 295 service()->UnloadExtension(bgapp->id(), |
| 296 bgapp->id(), extensions::UnloadedExtensionInfo::REASON_UNINSTALL); | 296 extensions::UnloadedExtensionReason::UNINSTALL); |
| 297 unload_observer.WaitForExtensionUnloaded(); | 297 unload_observer.WaitForExtensionUnloaded(); |
| 298 ASSERT_TRUE(registry()->enabled_extensions().is_empty()); | 298 ASSERT_TRUE(registry()->enabled_extensions().is_empty()); |
| 299 EXPECT_EQ(0U, model()->size()); | 299 EXPECT_EQ(0U, model()->size()); |
| 300 } | 300 } |
| 301 | 301 |
| 302 TEST_F(BackgroundApplicationListModelTest, LateExtensionSystemReady) { | 302 TEST_F(BackgroundApplicationListModelTest, LateExtensionSystemReady) { |
| 303 ASSERT_FALSE(service()->is_ready()); | 303 ASSERT_FALSE(service()->is_ready()); |
| 304 ASSERT_FALSE(model()->is_ready()); | 304 ASSERT_FALSE(model()->is_ready()); |
| 305 service()->Init(); | 305 service()->Init(); |
| 306 // Model is not ready yet since ExtensionSystem::ready() is dispatched using | 306 // Model is not ready yet since ExtensionSystem::ready() is dispatched using |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 457 break; | 457 break; |
| 458 case 2: | 458 case 2: |
| 459 TogglePermission(service(), &extensions, model(), &expected, &count); | 459 TogglePermission(service(), &extensions, model(), &expected, &count); |
| 460 break; | 460 break; |
| 461 default: | 461 default: |
| 462 NOTREACHED(); | 462 NOTREACHED(); |
| 463 break; | 463 break; |
| 464 } | 464 } |
| 465 } | 465 } |
| 466 } | 466 } |
| OLD | NEW |