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

Side by Side Diff: chrome/common/extensions/extension_l10n_util_unittest.cc

Issue 8693005: Remove potentially many static initializers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 1 month 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) 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 "base/file_path.h" 5 #include "base/file_path.h"
6 #include "base/file_util.h" 6 #include "base/file_util.h"
7 #include "base/memory/linked_ptr.h" 7 #include "base/memory/linked_ptr.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/scoped_temp_dir.h" 10 #include "base/scoped_temp_dir.h"
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 return bundle; 250 return bundle;
251 } 251 }
252 252
253 TEST(ExtensionL10nUtil, LocalizeEmptyManifest) { 253 TEST(ExtensionL10nUtil, LocalizeEmptyManifest) {
254 DictionaryValue manifest; 254 DictionaryValue manifest;
255 std::string error; 255 std::string error;
256 scoped_ptr<ExtensionMessageBundle> messages(CreateManifestBundle()); 256 scoped_ptr<ExtensionMessageBundle> messages(CreateManifestBundle());
257 257
258 EXPECT_FALSE( 258 EXPECT_FALSE(
259 extension_l10n_util::LocalizeManifest(*messages, &manifest, &error)); 259 extension_l10n_util::LocalizeManifest(*messages, &manifest, &error));
260 EXPECT_EQ(errors::kInvalidName, error); 260 EXPECT_EQ(std::string(errors::kInvalidName), error);
Ryan Sleevi 2011/11/24 20:13:59 EXPECT_STREQ ?
261 } 261 }
262 262
263 TEST(ExtensionL10nUtil, LocalizeManifestWithoutNameMsgAndEmptyDescription) { 263 TEST(ExtensionL10nUtil, LocalizeManifestWithoutNameMsgAndEmptyDescription) {
264 DictionaryValue manifest; 264 DictionaryValue manifest;
265 manifest.SetString(keys::kName, "no __MSG"); 265 manifest.SetString(keys::kName, "no __MSG");
266 std::string error; 266 std::string error;
267 scoped_ptr<ExtensionMessageBundle> messages(CreateManifestBundle()); 267 scoped_ptr<ExtensionMessageBundle> messages(CreateManifestBundle());
268 268
269 EXPECT_TRUE( 269 EXPECT_TRUE(
270 extension_l10n_util::LocalizeManifest(*messages, &manifest, &error)); 270 extension_l10n_util::LocalizeManifest(*messages, &manifest, &error));
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 DictionaryValue manifest; 452 DictionaryValue manifest;
453 manifest.SetString(keys::kDefaultLocale, "en_US"); 453 manifest.SetString(keys::kDefaultLocale, "en_US");
454 manifest.SetString(keys::kCurrentLocale, "sr"); 454 manifest.SetString(keys::kCurrentLocale, "sr");
455 455
456 ExtensionInfo info(&manifest, "", FilePath(), Extension::LOAD); 456 ExtensionInfo info(&manifest, "", FilePath(), Extension::LOAD);
457 457
458 EXPECT_TRUE(extension_l10n_util::ShouldRelocalizeManifest(info)); 458 EXPECT_TRUE(extension_l10n_util::ShouldRelocalizeManifest(info));
459 } 459 }
460 460
461 } // namespace 461 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698