Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Side by Side Diff: chrome/common/extensions/manifest_tests/extension_manifest_test.cc

Issue 12091115: Allow manifest handlers to declare keys they depend on that must be parsed before them. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: dcronin Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/common/extensions/manifest_tests/extension_manifest_test.h" 5 #include "chrome/common/extensions/manifest_tests/extension_manifest_test.h"
6 6
7 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "base/json/json_file_value_serializer.h" 10 #include "base/json/json_file_value_serializer.h"
11 #include "base/path_service.h" 11 #include "base/path_service.h"
12 #include "chrome/common/chrome_paths.h" 12 #include "chrome/common/chrome_paths.h"
13 #include "chrome/common/extensions/extension_l10n_util.h" 13 #include "chrome/common/extensions/extension_l10n_util.h"
14 #include "chrome/common/extensions/manifest_handler.h"
14 #include "ui/base/l10n/l10n_util.h" 15 #include "ui/base/l10n/l10n_util.h"
15 16
16 using extensions::Extension; 17 using extensions::Extension;
17 18
18 ExtensionManifestTest::ExtensionManifestTest() 19 ExtensionManifestTest::ExtensionManifestTest()
19 : enable_apps_(true), 20 : enable_apps_(true),
20 // UNKNOWN == trunk. 21 // UNKNOWN == trunk.
21 current_channel_(chrome::VersionInfo::CHANNEL_UNKNOWN) {} 22 current_channel_(chrome::VersionInfo::CHANNEL_UNKNOWN) {}
22 23
24 void ExtensionManifestTest::SetUp() {
25 extensions::ManifestHandler::ClearRegistryForTesting();
26 }
27
23 // static 28 // static
24 DictionaryValue* ExtensionManifestTest::LoadManifestFile( 29 DictionaryValue* ExtensionManifestTest::LoadManifestFile(
25 const std::string& filename, 30 const std::string& filename,
26 std::string* error) { 31 std::string* error) {
27 FilePath filename_path(FilePath::FromUTF8Unsafe(filename)); 32 FilePath filename_path(FilePath::FromUTF8Unsafe(filename));
28 FilePath extension_path; 33 FilePath extension_path;
29 FilePath manifest_path; 34 FilePath manifest_path;
30 35
31 if (filename_path.IsAbsolute()) { 36 if (filename_path.IsAbsolute()) {
32 extension_path = filename_path.DirName(); 37 extension_path = filename_path.DirName();
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 break; 243 break;
239 case EXPECT_TYPE_SUCCESS: 244 case EXPECT_TYPE_SUCCESS:
240 for (size_t i = 0; i < num_testcases; ++i) { 245 for (size_t i = 0; i < num_testcases; ++i) {
241 LoadAndExpectSuccess(testcases[i].manifest_filename_.c_str(), 246 LoadAndExpectSuccess(testcases[i].manifest_filename_.c_str(),
242 testcases[i].location_, 247 testcases[i].location_,
243 testcases[i].flags_); 248 testcases[i].flags_);
244 } 249 }
245 break; 250 break;
246 } 251 }
247 } 252 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698