| 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 #include <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "chrome/browser/extensions/component_loader.h" | 7 #include "chrome/browser/extensions/component_loader.h" |
| 8 | 8 |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 namespace extensions { | 72 namespace extensions { |
| 73 | 73 |
| 74 class ComponentLoaderTest : public testing::Test { | 74 class ComponentLoaderTest : public testing::Test { |
| 75 public: | 75 public: |
| 76 ComponentLoaderTest() : | 76 ComponentLoaderTest() : |
| 77 // Note: we pass the same pref service here, to stand in for both | 77 // Note: we pass the same pref service here, to stand in for both |
| 78 // user prefs and local state. | 78 // user prefs and local state. |
| 79 component_loader_(&extension_service_, &prefs_, &local_state_) { | 79 component_loader_(&extension_service_, &prefs_, &local_state_) { |
| 80 } | 80 } |
| 81 | 81 |
| 82 void SetUp() { | 82 virtual void SetUp() { |
| 83 extension_path_ = | 83 extension_path_ = |
| 84 GetBasePath().AppendASCII("good") | 84 GetBasePath().AppendASCII("good") |
| 85 .AppendASCII("Extensions") | 85 .AppendASCII("Extensions") |
| 86 .AppendASCII("behllobkkfkfnphdnhnkndlbkcpglgmj") | 86 .AppendASCII("behllobkkfkfnphdnhnkndlbkcpglgmj") |
| 87 .AppendASCII("1.0.0.0"); | 87 .AppendASCII("1.0.0.0"); |
| 88 | 88 |
| 89 // Read in the extension manifest. | 89 // Read in the extension manifest. |
| 90 ASSERT_TRUE(file_util::ReadFileToString( | 90 ASSERT_TRUE(file_util::ReadFileToString( |
| 91 extension_path_.Append(Extension::kManifestFilename), | 91 extension_path_.Append(Extension::kManifestFilename), |
| 92 &manifest_contents_)); | 92 &manifest_contents_)); |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 EXPECT_EQ(default_count + 1, extension_service_.extensions()->size()); | 306 EXPECT_EQ(default_count + 1, extension_service_.extensions()->size()); |
| 307 EXPECT_EQ(0u, extension_service_.unloaded_count()); | 307 EXPECT_EQ(0u, extension_service_.unloaded_count()); |
| 308 | 308 |
| 309 // replace loaded component extension. | 309 // replace loaded component extension. |
| 310 component_loader_.AddOrReplace(known_extension); | 310 component_loader_.AddOrReplace(known_extension); |
| 311 EXPECT_EQ(default_count + 1, extension_service_.extensions()->size()); | 311 EXPECT_EQ(default_count + 1, extension_service_.extensions()->size()); |
| 312 EXPECT_EQ(1u, extension_service_.unloaded_count()); | 312 EXPECT_EQ(1u, extension_service_.unloaded_count()); |
| 313 } | 313 } |
| 314 | 314 |
| 315 } // namespace extensions | 315 } // namespace extensions |
| OLD | NEW |