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

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

Issue 236213002: Move most of extension_file_util.cc into extensions/common/file_util.cc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase (file-util) Created 6 years, 8 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_util.h" 7 #include "base/file_util.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/json/json_file_value_serializer.h" 9 #include "base/json/json_file_value_serializer.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 21 matching lines...) Expand all
32 EXPECT_TRUE(base::PathExists(manifest_path)) << 32 EXPECT_TRUE(base::PathExists(manifest_path)) <<
33 "Couldn't find " << manifest_path.value(); 33 "Couldn't find " << manifest_path.value();
34 34
35 JSONFileValueSerializer serializer(manifest_path); 35 JSONFileValueSerializer serializer(manifest_path);
36 base::DictionaryValue* manifest = 36 base::DictionaryValue* manifest =
37 static_cast<base::DictionaryValue*>(serializer.Deserialize(NULL, error)); 37 static_cast<base::DictionaryValue*>(serializer.Deserialize(NULL, error));
38 38
39 // Most unit tests don't need localization, and they'll fail if we try to 39 // Most unit tests don't need localization, and they'll fail if we try to
40 // localize them, since their manifests don't have a default_locale key. 40 // localize them, since their manifests don't have a default_locale key.
41 // Only localize manifests that indicate they want to be localized. 41 // Only localize manifests that indicate they want to be localized.
42 // Calling LocalizeExtension at this point mirrors 42 // Calling LocalizeExtension at this point mirrors file_util::LoadExtension.
43 // extension_file_util::LoadExtension.
44 if (manifest && 43 if (manifest &&
45 filename_path.value().find(FILE_PATH_LITERAL("localized")) != 44 filename_path.value().find(FILE_PATH_LITERAL("localized")) !=
46 std::string::npos) 45 std::string::npos)
47 extension_l10n_util::LocalizeExtension(extension_path, manifest, error); 46 extension_l10n_util::LocalizeExtension(extension_path, manifest, error);
48 47
49 return manifest; 48 return manifest;
50 } 49 }
51 50
52 } // namespace 51 } // namespace
53 52
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 testcase.location_, 272 testcase.location_,
274 testcase.flags_); 273 testcase.flags_);
275 break; 274 break;
276 case EXPECT_TYPE_SUCCESS: 275 case EXPECT_TYPE_SUCCESS:
277 LoadAndExpectSuccess(testcase.manifest_filename_.c_str(), 276 LoadAndExpectSuccess(testcase.manifest_filename_.c_str(),
278 testcase.location_, 277 testcase.location_,
279 testcase.flags_); 278 testcase.flags_);
280 break; 279 break;
281 } 280 }
282 } 281 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698