OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/extensions_service_unittest.h" | 5 #include "chrome/browser/extensions/extensions_service_unittest.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 1509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1520 | 1520 |
1521 // Extension counts shouldn't change. | 1521 // Extension counts shouldn't change. |
1522 EXPECT_EQ(0u, service_->extensions()->size()); | 1522 EXPECT_EQ(0u, service_->extensions()->size()); |
1523 EXPECT_EQ(1u, service_->disabled_extensions()->size()); | 1523 EXPECT_EQ(1u, service_->disabled_extensions()->size()); |
1524 | 1524 |
1525 service_->EnableExtension(extension_id); | 1525 service_->EnableExtension(extension_id); |
1526 | 1526 |
1527 EXPECT_EQ(1u, service_->extensions()->size()); | 1527 EXPECT_EQ(1u, service_->extensions()->size()); |
1528 EXPECT_EQ(0u, service_->disabled_extensions()->size()); | 1528 EXPECT_EQ(0u, service_->disabled_extensions()->size()); |
1529 | 1529 |
| 1530 // Need to clear |loaded_| manually before reloading as the |
| 1531 // EnableExtension() call above inserted into it and |
| 1532 // UnloadAllExtensions() doesn't send out notifications. |
| 1533 loaded_.clear(); |
1530 service_->ReloadExtensions(); | 1534 service_->ReloadExtensions(); |
1531 | 1535 |
1532 // Extension counts shouldn't change. | 1536 // Extension counts shouldn't change. |
1533 EXPECT_EQ(1u, service_->extensions()->size()); | 1537 EXPECT_EQ(1u, service_->extensions()->size()); |
1534 EXPECT_EQ(0u, service_->disabled_extensions()->size()); | 1538 EXPECT_EQ(0u, service_->disabled_extensions()->size()); |
1535 } | 1539 } |
1536 | 1540 |
1537 // Tests uninstalling normal extensions | 1541 // Tests uninstalling normal extensions |
1538 TEST_F(ExtensionsServiceTest, UninstallExtension) { | 1542 TEST_F(ExtensionsServiceTest, UninstallExtension) { |
1539 InitializeEmptyExtensionsService(); | 1543 InitializeEmptyExtensionsService(); |
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2095 // Component extensions shouldn't get recourded in the prefs. | 2099 // Component extensions shouldn't get recourded in the prefs. |
2096 ValidatePrefKeyCount(0); | 2100 ValidatePrefKeyCount(0); |
2097 | 2101 |
2098 // Reload all extensions, and make sure it comes back. | 2102 // Reload all extensions, and make sure it comes back. |
2099 std::string extension_id = service_->extensions()->at(0)->id(); | 2103 std::string extension_id = service_->extensions()->at(0)->id(); |
2100 loaded_.clear(); | 2104 loaded_.clear(); |
2101 service_->ReloadExtensions(); | 2105 service_->ReloadExtensions(); |
2102 ASSERT_EQ(1u, service_->extensions()->size()); | 2106 ASSERT_EQ(1u, service_->extensions()->size()); |
2103 EXPECT_EQ(extension_id, service_->extensions()->at(0)->id()); | 2107 EXPECT_EQ(extension_id, service_->extensions()->at(0)->id()); |
2104 } | 2108 } |
OLD | NEW |