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

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

Issue 2740143002: Change base::Value::ListStorage to std::vector<base::Value> (Closed)
Patch Set: Rebase Created 3 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/common/extension_l10n_util.h" 5 #include "extensions/common/extension_l10n_util.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 421
422 EXPECT_TRUE(error.empty()); 422 EXPECT_TRUE(error.empty());
423 } 423 }
424 424
425 TEST(ExtensionL10nUtil, LocalizeManifestWithNameDescriptionFileHandlerTitle) { 425 TEST(ExtensionL10nUtil, LocalizeManifestWithNameDescriptionFileHandlerTitle) {
426 base::DictionaryValue manifest; 426 base::DictionaryValue manifest;
427 manifest.SetString(keys::kName, "__MSG_name__"); 427 manifest.SetString(keys::kName, "__MSG_name__");
428 manifest.SetString(keys::kDescription, "__MSG_description__"); 428 manifest.SetString(keys::kDescription, "__MSG_description__");
429 base::ListValue* handlers = new base::ListValue(); 429 base::ListValue* handlers = new base::ListValue();
430 manifest.Set(keys::kFileBrowserHandlers, handlers); 430 manifest.Set(keys::kFileBrowserHandlers, handlers);
431 base::DictionaryValue* handler = new base::DictionaryValue(); 431 handlers->Append(base::MakeUnique<base::DictionaryValue>());
432 handlers->Append(base::WrapUnique(handler)); 432 base::DictionaryValue* handler = nullptr;
433 handlers->GetDictionary(0, &handler);
433 handler->SetString(keys::kPageActionDefaultTitle, 434 handler->SetString(keys::kPageActionDefaultTitle,
434 "__MSG_file_handler_title__"); 435 "__MSG_file_handler_title__");
435 436
436 std::string error; 437 std::string error;
437 std::unique_ptr<MessageBundle> messages(CreateManifestBundle()); 438 std::unique_ptr<MessageBundle> messages(CreateManifestBundle());
438 439
439 EXPECT_TRUE( 440 EXPECT_TRUE(
440 extension_l10n_util::LocalizeManifest(*messages, &manifest, &error)); 441 extension_l10n_util::LocalizeManifest(*messages, &manifest, &error));
441 442
442 std::string result; 443 std::string result;
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
635 extension_l10n_util::GetAllFallbackLocales("en_US", "all", &fallback_locales); 636 extension_l10n_util::GetAllFallbackLocales("en_US", "all", &fallback_locales);
636 ASSERT_EQ(3U, fallback_locales.size()); 637 ASSERT_EQ(3U, fallback_locales.size());
637 638
638 CHECK_EQ("en_US", fallback_locales[0]); 639 CHECK_EQ("en_US", fallback_locales[0]);
639 CHECK_EQ("en", fallback_locales[1]); 640 CHECK_EQ("en", fallback_locales[1]);
640 CHECK_EQ("all", fallback_locales[2]); 641 CHECK_EQ("all", fallback_locales[2]);
641 } 642 }
642 643
643 } // namespace 644 } // namespace
644 } // namespace extensions 645 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698