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

Unified Diff: chrome/browser/download/download_ui_controller_unittest.cc

Issue 2758713002: Avoid to use the method pointer to Callback<>::Run on gmock tests (Closed)
Patch Set: Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | components/ntp_snippets/remote/remote_suggestions_provider_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/download_ui_controller_unittest.cc
diff --git a/chrome/browser/download/download_ui_controller_unittest.cc b/chrome/browser/download/download_ui_controller_unittest.cc
index 7c812c4ef4aa290eaa6304f1418acf66bc861f8c..1b5036a4e5455be94a214450e062c8bf652da890 100644
--- a/chrome/browser/download/download_ui_controller_unittest.cc
+++ b/chrome/browser/download/download_ui_controller_unittest.cc
@@ -23,6 +23,7 @@
#include "content/public/test/mock_download_item.h"
#include "content/public/test/mock_download_manager.h"
#include "testing/gmock/include/gmock/gmock.h"
+#include "testing/gmock_mutant.h"
#include "testing/gtest/include/gtest/gtest.h"
using content::MockDownloadItem;
@@ -30,6 +31,7 @@ using content::MockDownloadManager;
using history::HistoryService;
using testing::AnyNumber;
using testing::Assign;
+using testing::CreateFunctor;
using testing::Return;
using testing::ReturnRefOfCopy;
using testing::SaveArg;
@@ -341,10 +343,10 @@ TEST_F(DownloadUIControllerTest, DownloadUIController_HistoryDownload) {
base::Unretained(download_history_manager_observer()),
manager(),
item.get());
- EXPECT_CALL(*manager(), MockCreateDownloadItem(_)).WillOnce(
- testing::DoAll(testing::InvokeWithoutArgs(&history_on_created_callback,
- &base::Closure::Run),
- Return(item.get())));
+ EXPECT_CALL(*manager(), MockCreateDownloadItem(_))
+ .WillOnce(testing::DoAll(testing::InvokeWithoutArgs(CreateFunctor(
+ history_on_created_callback)),
+ Return(item.get())));
EXPECT_CALL(mock_function, Call());
history_query_callback().Run(std::move(history_downloads));
« no previous file with comments | « no previous file | components/ntp_snippets/remote/remote_suggestions_provider_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698