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

Unified Diff: chrome/browser/extensions/updater/extension_updater_unittest.cc

Issue 829583002: Validate hash_sha256 checksum on .crx update. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add histogram description. Created 6 years 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/updater/extension_updater_unittest.cc
diff --git a/chrome/browser/extensions/updater/extension_updater_unittest.cc b/chrome/browser/extensions/updater/extension_updater_unittest.cc
index ff6d8081a239fee0bbadf9ec2a57de985d50f7d2..0fbd1dd1835b018a7eac322ea4ea0d3ac82fe7d0 100644
--- a/chrome/browser/extensions/updater/extension_updater_unittest.cc
+++ b/chrome/browser/extensions/updater/extension_updater_unittest.cc
@@ -145,13 +145,15 @@ class MockExtensionDownloaderDelegate : public ExtensionDownloaderDelegate {
Error,
const PingResult&,
const std::set<int>&));
- MOCK_METHOD7(OnExtensionDownloadFinished, void(const std::string&,
- const base::FilePath&,
- bool,
- const GURL&,
- const std::string&,
- const PingResult&,
- const std::set<int>&));
+ MOCK_METHOD8(OnExtensionDownloadFinished,
+ void(const std::string&,
+ const base::FilePath&,
+ const std::string&,
+ bool,
+ const GURL&,
+ const std::string&,
+ const PingResult&,
+ const std::set<int>&));
MOCK_METHOD2(GetPingDataForExtension,
bool(const std::string&, ManifestFetchData::PingData*));
MOCK_METHOD1(GetUpdateUrlData, std::string(const std::string&));
@@ -175,9 +177,10 @@ class MockExtensionDownloaderDelegate : public ExtensionDownloaderDelegate {
ON_CALL(*this, OnExtensionDownloadFailed(_, _, _, _))
.WillByDefault(Invoke(delegate,
&ExtensionDownloaderDelegate::OnExtensionDownloadFailed));
- ON_CALL(*this, OnExtensionDownloadFinished(_, _, _, _, _, _, _))
- .WillByDefault(Invoke(delegate,
- &ExtensionDownloaderDelegate::OnExtensionDownloadFinished));
+ ON_CALL(*this, OnExtensionDownloadFinished(_, _, _, _, _, _, _, _))
+ .WillByDefault(
+ Invoke(delegate,
+ &ExtensionDownloaderDelegate::OnExtensionDownloadFinished));
ON_CALL(*this, GetPingDataForExtension(_, _))
.WillByDefault(Invoke(delegate,
&ExtensionDownloaderDelegate::GetPingDataForExtension));
@@ -514,6 +517,15 @@ class ServiceForDownloadTests : public MockService {
return false;
}
+ bool CheckAndUpdateExtension(const std::string& id,
+ const base::FilePath& extension_path,
+ const std::string& hash,
+ bool file_ownership_passed,
+ CrxInstaller** out_crx_installer) override {
+ return UpdateExtension(
+ id, extension_path, file_ownership_passed, out_crx_installer);
+ }
+
PendingExtensionManager* pending_extension_manager() override {
return &pending_extension_manager_;
}
@@ -1220,8 +1232,9 @@ class ExtensionUpdaterTest : public testing::Test {
} else {
fetcher->set_response_code(200);
fetcher->SetResponseFilePath(extension_file_path);
- EXPECT_CALL(delegate, OnExtensionDownloadFinished(
- id, _, _, _, version.GetString(), _, requests));
+ EXPECT_CALL(delegate,
+ OnExtensionDownloadFinished(
+ id, _, _, _, _, version.GetString(), _, requests));
}
fetcher->delegate()->OnURLFetchComplete(fetcher);

Powered by Google App Engine
This is Rietveld 408576698