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

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

Issue 671011: All platforms don't support same locales at the same time. Make locale check ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 9 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
« no previous file with comments | « chrome/common/extensions/extension_unpacker.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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_util.h" 5 #include "base/file_util.h"
6 #include "base/path_service.h" 6 #include "base/path_service.h"
7 #include "base/string_util.h" 7 #include "base/string_util.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "chrome/common/chrome_paths.h" 9 #include "chrome/common/chrome_paths.h"
10 #include "chrome/common/extensions/extension_constants.h" 10 #include "chrome/common/extensions/extension_constants.h"
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 SetupUnpacker("missing_messages_file.crx"); 93 SetupUnpacker("missing_messages_file.crx");
94 EXPECT_FALSE(unpacker_->Run()); 94 EXPECT_FALSE(unpacker_->Run());
95 EXPECT_TRUE(MatchPatternASCII(unpacker_->error_message(), 95 EXPECT_TRUE(MatchPatternASCII(unpacker_->error_message(),
96 errors::kLocalesMessagesFileMissing + 96 errors::kLocalesMessagesFileMissing +
97 std::string("*_locales?en_US?messages.json"))); 97 std::string("*_locales?en_US?messages.json")));
98 } 98 }
99 99
100 TEST_F(ExtensionUnpackerTest, NoLocaleData) { 100 TEST_F(ExtensionUnpackerTest, NoLocaleData) {
101 SetupUnpacker("no_locale_data.crx"); 101 SetupUnpacker("no_locale_data.crx");
102 EXPECT_FALSE(unpacker_->Run()); 102 EXPECT_FALSE(unpacker_->Run());
103 EXPECT_EQ(errors::kLocalesTreeMissing, unpacker_->error_message()); 103 EXPECT_EQ(errors::kLocalesNoDefaultMessages, unpacker_->error_message());
104 } 104 }
105 105
106 TEST_F(ExtensionUnpackerTest, GoodL10n) { 106 TEST_F(ExtensionUnpackerTest, GoodL10n) {
107 SetupUnpacker("good_l10n.crx"); 107 SetupUnpacker("good_l10n.crx");
108 EXPECT_TRUE(unpacker_->Run()); 108 EXPECT_TRUE(unpacker_->Run());
109 EXPECT_TRUE(unpacker_->error_message().empty()); 109 EXPECT_TRUE(unpacker_->error_message().empty());
110 ASSERT_EQ(2U, unpacker_->parsed_catalogs()->size()); 110 ASSERT_EQ(2U, unpacker_->parsed_catalogs()->size());
111 } 111 }
112 112
113 TEST_F(ExtensionUnpackerTest, NoL10n) { 113 TEST_F(ExtensionUnpackerTest, NoL10n) {
114 SetupUnpacker("no_l10n.crx"); 114 SetupUnpacker("no_l10n.crx");
115 EXPECT_TRUE(unpacker_->Run()); 115 EXPECT_TRUE(unpacker_->Run());
116 EXPECT_TRUE(unpacker_->error_message().empty()); 116 EXPECT_TRUE(unpacker_->error_message().empty());
117 EXPECT_EQ(0U, unpacker_->parsed_catalogs()->size()); 117 EXPECT_EQ(0U, unpacker_->parsed_catalogs()->size());
118 } 118 }
OLDNEW
« no previous file with comments | « chrome/common/extensions/extension_unpacker.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698