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

Unified Diff: chrome/browser/printing/cloud_print/cloud_print_proxy_service_unittest.cc

Issue 8586001: Fix memory leak in unit test. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/printing/cloud_print/cloud_print_proxy_service_unittest.cc
diff --git a/chrome/browser/printing/cloud_print/cloud_print_proxy_service_unittest.cc b/chrome/browser/printing/cloud_print/cloud_print_proxy_service_unittest.cc
index ddad989d4c938bd61b8357528d7b5f3e84287a6d..4f69a353feaf964cf8a410994afedeb791ab26a4 100644
--- a/chrome/browser/printing/cloud_print/cloud_print_proxy_service_unittest.cc
+++ b/chrome/browser/printing/cloud_print/cloud_print_proxy_service_unittest.cc
@@ -19,8 +19,11 @@
using ::testing::Assign;
using ::testing::AtMost;
+using ::testing::DeleteArg;
+using ::testing::DoAll;
using ::testing::Invoke;
using ::testing::Property;
+using ::testing::Return;
using ::testing::ReturnPointee;
using ::testing::WithArgs;
using ::testing::_;
@@ -97,8 +100,10 @@ void MockServiceProcessControl::SetServiceEnabledExpectations() {
Send(Property(&IPC::Message::type,
static_cast<int32>(ServiceMsg_GetCloudPrintProxyInfo::ID))))
.Times(1).WillOnce(
- WithoutArgs(
- Invoke(this, &MockServiceProcessControl::SendEnabledInfo)));
+ DoAll(
+ DeleteArg<0>(),
+ WithoutArgs(
+ Invoke(this, &MockServiceProcessControl::SendEnabledInfo))));
}
void MockServiceProcessControl::SetServiceDisabledExpectations() {
@@ -107,8 +112,10 @@ void MockServiceProcessControl::SetServiceDisabledExpectations() {
Send(Property(&IPC::Message::type,
static_cast<int32>(ServiceMsg_GetCloudPrintProxyInfo::ID))))
.Times(1).WillOnce(
- WithoutArgs(
- Invoke(this, &MockServiceProcessControl::SendDisabledInfo)));
+ DoAll(
+ DeleteArg<0>(),
+ WithoutArgs(
+ Invoke(this, &MockServiceProcessControl::SendDisabledInfo))));
}
void MockServiceProcessControl::SetWillBeEnabledExpectations() {
@@ -116,7 +123,7 @@ void MockServiceProcessControl::SetWillBeEnabledExpectations() {
*this,
Send(Property(&IPC::Message::type,
static_cast<int32>(ServiceMsg_EnableCloudPrintProxy::ID))))
- .Times(1);
+ .Times(1).WillOnce(DoAll(DeleteArg<0>(), Return(true)));
}
void MockServiceProcessControl::SetWillBeDisabledExpectations() {
@@ -124,7 +131,7 @@ void MockServiceProcessControl::SetWillBeDisabledExpectations() {
*this,
Send(Property(&IPC::Message::type,
static_cast<int32>(ServiceMsg_DisableCloudPrintProxy::ID))))
- .Times(1);
+ .Times(1).WillOnce(DoAll(DeleteArg<0>(), Return(true)));
}
bool MockServiceProcessControl::SendEnabledInfo() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698