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 "chrome/browser/extensions/component_loader.h" | 5 #include "chrome/browser/extensions/component_loader.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 } | 81 } |
82 | 82 |
83 virtual void SetUp() OVERRIDE { | 83 virtual void SetUp() OVERRIDE { |
84 extension_path_ = | 84 extension_path_ = |
85 GetBasePath().AppendASCII("good") | 85 GetBasePath().AppendASCII("good") |
86 .AppendASCII("Extensions") | 86 .AppendASCII("Extensions") |
87 .AppendASCII("behllobkkfkfnphdnhnkndlbkcpglgmj") | 87 .AppendASCII("behllobkkfkfnphdnhnkndlbkcpglgmj") |
88 .AppendASCII("1.0.0.0"); | 88 .AppendASCII("1.0.0.0"); |
89 | 89 |
90 // Read in the extension manifest. | 90 // Read in the extension manifest. |
91 ASSERT_TRUE(file_util::ReadFileToString( | 91 ASSERT_TRUE(base::ReadFileToString( |
92 extension_path_.Append(kManifestFilename), | 92 extension_path_.Append(kManifestFilename), |
93 &manifest_contents_)); | 93 &manifest_contents_)); |
94 | 94 |
95 // Register the local state prefs. | 95 // Register the local state prefs. |
96 #if defined(OS_CHROMEOS) | 96 #if defined(OS_CHROMEOS) |
97 local_state_.registry()->RegisterBooleanPref( | 97 local_state_.registry()->RegisterBooleanPref( |
98 prefs::kSpokenFeedbackEnabled, false); | 98 prefs::kSpokenFeedbackEnabled, false); |
99 #endif | 99 #endif |
100 } | 100 } |
101 | 101 |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 component_loader_.AddOrReplace(known_extension); | 261 component_loader_.AddOrReplace(known_extension); |
262 EXPECT_EQ(default_count + 1, extension_service_.extensions()->size()); | 262 EXPECT_EQ(default_count + 1, extension_service_.extensions()->size()); |
263 EXPECT_EQ(1u, extension_service_.unloaded_count()); | 263 EXPECT_EQ(1u, extension_service_.unloaded_count()); |
264 | 264 |
265 // Add an invalid component extension. | 265 // Add an invalid component extension. |
266 std::string extension_id = component_loader_.AddOrReplace(invalid_extension); | 266 std::string extension_id = component_loader_.AddOrReplace(invalid_extension); |
267 EXPECT_TRUE(extension_id.empty()); | 267 EXPECT_TRUE(extension_id.empty()); |
268 } | 268 } |
269 | 269 |
270 } // namespace extensions | 270 } // namespace extensions |
OLD | NEW |