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

Side by Side Diff: chrome/browser/extensions/extension_service_unittest.cc

Issue 684153002: Fix not localized strings in extension_error_reporter.cc (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix unit tests Created 6 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
« no previous file with comments | « chrome/browser/extensions/extension_error_reporter.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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 <algorithm> 5 #include <algorithm>
6 #include <set> 6 #include <set>
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/at_exit.h" 9 #include "base/at_exit.h"
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 1294 matching lines...) Expand 10 before | Expand all | Expand 10 after
1305 source_install_dir.DirName().Append(chrome::kPreferencesFilename); 1305 source_install_dir.DirName().Append(chrome::kPreferencesFilename);
1306 1306
1307 InitializeInstalledExtensionService(pref_path, source_install_dir); 1307 InitializeInstalledExtensionService(pref_path, source_install_dir);
1308 1308
1309 service()->Init(); 1309 service()->Init();
1310 1310
1311 ASSERT_EQ(4u, GetErrors().size()); 1311 ASSERT_EQ(4u, GetErrors().size());
1312 ASSERT_EQ(0u, loaded_.size()); 1312 ASSERT_EQ(0u, loaded_.size());
1313 1313
1314 EXPECT_TRUE(MatchPattern(base::UTF16ToUTF8(GetErrors()[0]), 1314 EXPECT_TRUE(MatchPattern(base::UTF16ToUTF8(GetErrors()[0]),
1315 std::string("Could not load extension from '*'. ") + 1315 std::string("Failed to load extension from: *. ") +
Devlin 2014/10/30 15:38:58 This makes the tests rely on the bots running in E
1316 extensions::manifest_errors::kManifestUnreadable)) << 1316 extensions::manifest_errors::kManifestUnreadable)) <<
1317 base::UTF16ToUTF8(GetErrors()[0]); 1317 base::UTF16ToUTF8(GetErrors()[0]);
1318 1318
1319 EXPECT_TRUE(MatchPattern(base::UTF16ToUTF8(GetErrors()[1]), 1319 EXPECT_TRUE(MatchPattern(base::UTF16ToUTF8(GetErrors()[1]),
1320 std::string("Could not load extension from '*'. ") + 1320 std::string("Failed to load extension from: *. ") +
1321 extensions::manifest_errors::kManifestUnreadable)) << 1321 extensions::manifest_errors::kManifestUnreadable)) <<
1322 base::UTF16ToUTF8(GetErrors()[1]); 1322 base::UTF16ToUTF8(GetErrors()[1]);
1323 1323
1324 EXPECT_TRUE(MatchPattern(base::UTF16ToUTF8(GetErrors()[2]), 1324 EXPECT_TRUE(MatchPattern(base::UTF16ToUTF8(GetErrors()[2]),
1325 std::string("Could not load extension from '*'. ") + 1325 std::string("Failed to load extension from: *. ") +
1326 extensions::manifest_errors::kMissingFile)) << 1326 extensions::manifest_errors::kMissingFile)) <<
1327 base::UTF16ToUTF8(GetErrors()[2]); 1327 base::UTF16ToUTF8(GetErrors()[2]);
1328 1328
1329 EXPECT_TRUE(MatchPattern(base::UTF16ToUTF8(GetErrors()[3]), 1329 EXPECT_TRUE(MatchPattern(base::UTF16ToUTF8(GetErrors()[3]),
1330 std::string("Could not load extension from '*'. ") + 1330 std::string("Failed to load extension from: *. ") +
1331 extensions::manifest_errors::kManifestUnreadable)) << 1331 extensions::manifest_errors::kManifestUnreadable)) <<
1332 base::UTF16ToUTF8(GetErrors()[3]); 1332 base::UTF16ToUTF8(GetErrors()[3]);
1333 }; 1333 };
1334 1334
1335 // Test various cases for delayed install because of missing imports. 1335 // Test various cases for delayed install because of missing imports.
1336 TEST_F(ExtensionServiceTest, PendingImports) { 1336 TEST_F(ExtensionServiceTest, PendingImports) {
1337 InitPluginService(); 1337 InitPluginService();
1338 1338
1339 base::FilePath source_install_dir = 1339 base::FilePath source_install_dir =
1340 data_dir().AppendASCII("pending_updates_with_imports").AppendASCII( 1340 data_dir().AppendASCII("pending_updates_with_imports").AppendASCII(
(...skipping 5790 matching lines...) Expand 10 before | Expand all | Expand 10 after
7131 7131
7132 service()->Observe(chrome::NOTIFICATION_PROFILE_DESTRUCTION_STARTED, 7132 service()->Observe(chrome::NOTIFICATION_PROFILE_DESTRUCTION_STARTED,
7133 content::Source<Profile>(profile()), 7133 content::Source<Profile>(profile()),
7134 content::NotificationService::NoDetails()); 7134 content::NotificationService::NoDetails());
7135 EXPECT_EQ(UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN, unloaded_reason_); 7135 EXPECT_EQ(UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN, unloaded_reason_);
7136 EXPECT_EQ(0u, registry()->enabled_extensions().size()); 7136 EXPECT_EQ(0u, registry()->enabled_extensions().size());
7137 EXPECT_EQ(0u, registry()->disabled_extensions().size()); 7137 EXPECT_EQ(0u, registry()->disabled_extensions().size());
7138 EXPECT_EQ(0u, registry()->terminated_extensions().size()); 7138 EXPECT_EQ(0u, registry()->terminated_extensions().size());
7139 EXPECT_EQ(0u, registry()->blacklisted_extensions().size()); 7139 EXPECT_EQ(0u, registry()->blacklisted_extensions().size());
7140 } 7140 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_error_reporter.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698