OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 case NotificationType::EXTENSION_LOADED: { | 441 case NotificationType::EXTENSION_LOADED: { |
442 const Extension* extension = Details<const Extension>(details).ptr(); | 442 const Extension* extension = Details<const Extension>(details).ptr(); |
443 loaded_.push_back(make_scoped_refptr(extension)); | 443 loaded_.push_back(make_scoped_refptr(extension)); |
444 // The tests rely on the errors being in a certain order, which can vary | 444 // The tests rely on the errors being in a certain order, which can vary |
445 // depending on how filesystem iteration works. | 445 // depending on how filesystem iteration works. |
446 std::stable_sort(loaded_.begin(), loaded_.end(), ExtensionsOrder()); | 446 std::stable_sort(loaded_.begin(), loaded_.end(), ExtensionsOrder()); |
447 break; | 447 break; |
448 } | 448 } |
449 | 449 |
450 case NotificationType::EXTENSION_UNLOADED: { | 450 case NotificationType::EXTENSION_UNLOADED: { |
451 const Extension* e = Details<const Extension>(details).ptr(); | 451 const Extension* e = |
| 452 Details<UnloadedExtensionInfo>(details)->extension; |
452 unloaded_id_ = e->id(); | 453 unloaded_id_ = e->id(); |
453 ExtensionList::iterator i = | 454 ExtensionList::iterator i = |
454 std::find(loaded_.begin(), loaded_.end(), e); | 455 std::find(loaded_.begin(), loaded_.end(), e); |
455 // TODO(erikkay) fix so this can be an assert. Right now the tests | 456 // TODO(erikkay) fix so this can be an assert. Right now the tests |
456 // are manually calling clear() on loaded_, so this isn't doable. | 457 // are manually calling clear() on loaded_, so this isn't doable. |
457 if (i == loaded_.end()) | 458 if (i == loaded_.end()) |
458 return; | 459 return; |
459 loaded_.erase(i); | 460 loaded_.erase(i); |
460 break; | 461 break; |
461 } | 462 } |
(...skipping 2792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3254 // Component extensions shouldn't get recourded in the prefs. | 3255 // Component extensions shouldn't get recourded in the prefs. |
3255 ValidatePrefKeyCount(0); | 3256 ValidatePrefKeyCount(0); |
3256 | 3257 |
3257 // Reload all extensions, and make sure it comes back. | 3258 // Reload all extensions, and make sure it comes back. |
3258 std::string extension_id = service_->extensions()->at(0)->id(); | 3259 std::string extension_id = service_->extensions()->at(0)->id(); |
3259 loaded_.clear(); | 3260 loaded_.clear(); |
3260 service_->ReloadExtensions(); | 3261 service_->ReloadExtensions(); |
3261 ASSERT_EQ(1u, service_->extensions()->size()); | 3262 ASSERT_EQ(1u, service_->extensions()->size()); |
3262 EXPECT_EQ(extension_id, service_->extensions()->at(0)->id()); | 3263 EXPECT_EQ(extension_id, service_->extensions()->at(0)->id()); |
3263 } | 3264 } |
OLD | NEW |