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 2071 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2082 extensions_path = extensions_path.AppendASCII("extensions"); | 2082 extensions_path = extensions_path.AppendASCII("extensions"); |
2083 FilePath path = extensions_path.AppendASCII("good.crx"); | 2083 FilePath path = extensions_path.AppendASCII("good.crx"); |
2084 UpdateExtension(kGoodId, path, INSTALLED); | 2084 UpdateExtension(kGoodId, path, INSTALLED); |
2085 | 2085 |
2086 EXPECT_FALSE(ContainsKey(service_->pending_extensions(), kGoodId)); | 2086 EXPECT_FALSE(ContainsKey(service_->pending_extensions(), kGoodId)); |
2087 | 2087 |
2088 const Extension* extension = service_->GetExtensionById(kGoodId, true); | 2088 const Extension* extension = service_->GetExtensionById(kGoodId, true); |
2089 ASSERT_TRUE(extension); | 2089 ASSERT_TRUE(extension); |
2090 | 2090 |
2091 bool enabled = service_->GetExtensionById(kGoodId, false); | 2091 bool enabled = service_->GetExtensionById(kGoodId, false); |
2092 EXPECT_EQ(kGoodInitialState == Extension::ENABLED, enabled); | 2092 EXPECT_EQ(enabled, kGoodInitialState == Extension::ENABLED); |
2093 EXPECT_EQ(kGoodInitialState, | 2093 EXPECT_EQ(kGoodInitialState, |
2094 service_->extension_prefs()->GetExtensionState(extension->id())); | 2094 service_->extension_prefs()->GetExtensionState(extension->id())); |
2095 EXPECT_EQ(kGoodInitialIncognitoEnabled, | 2095 EXPECT_EQ(kGoodInitialIncognitoEnabled, |
2096 service_->IsIncognitoEnabled(extension)); | 2096 service_->IsIncognitoEnabled(extension)); |
2097 } | 2097 } |
2098 | 2098 |
2099 namespace { | 2099 namespace { |
2100 | 2100 |
2101 bool IsTheme(const Extension& extension) { | 2101 bool IsTheme(const Extension& extension) { |
2102 return extension.is_theme(); | 2102 return extension.is_theme(); |
(...skipping 1310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3413 // Component extensions shouldn't get recourded in the prefs. | 3413 // Component extensions shouldn't get recourded in the prefs. |
3414 ValidatePrefKeyCount(0); | 3414 ValidatePrefKeyCount(0); |
3415 | 3415 |
3416 // Reload all extensions, and make sure it comes back. | 3416 // Reload all extensions, and make sure it comes back. |
3417 std::string extension_id = service_->extensions()->at(0)->id(); | 3417 std::string extension_id = service_->extensions()->at(0)->id(); |
3418 loaded_.clear(); | 3418 loaded_.clear(); |
3419 service_->ReloadExtensions(); | 3419 service_->ReloadExtensions(); |
3420 ASSERT_EQ(1u, service_->extensions()->size()); | 3420 ASSERT_EQ(1u, service_->extensions()->size()); |
3421 EXPECT_EQ(extension_id, service_->extensions()->at(0)->id()); | 3421 EXPECT_EQ(extension_id, service_->extensions()->at(0)->id()); |
3422 } | 3422 } |
OLD | NEW |