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

Unified Diff: remoting/host/log_to_server_unittest.cc

Issue 8669007: Fix leaks from a unit test added in r111239. (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: remoting/host/log_to_server_unittest.cc
diff --git a/remoting/host/log_to_server_unittest.cc b/remoting/host/log_to_server_unittest.cc
index 768abc465a95dc8204a0c7cea6f0a2c9cff2dc51..0667fd13dfb5e490e7cc83c6ef27737405d7871f 100644
--- a/remoting/host/log_to_server_unittest.cc
+++ b/remoting/host/log_to_server_unittest.cc
@@ -9,9 +9,12 @@
#include "testing/gmock_mutant.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "third_party/libjingle/source/talk/xmllite/xmlelement.h"
using testing::_;
+using testing::DeleteArg;
using testing::InSequence;
+using testing::Return;
namespace remoting {
@@ -43,7 +46,8 @@ TEST_F(LogToServerTest, SendNow) {
InSequence s;
EXPECT_CALL(signal_strategy_, AddListener(_));
EXPECT_CALL(signal_strategy_, GetNextId());
- EXPECT_CALL(signal_strategy_, SendStanza(_));
+ EXPECT_CALL(signal_strategy_, SendStanza(_))
+ .WillOnce(DoAll(DeleteArg<0>(), Return(true)));
EXPECT_CALL(signal_strategy_, RemoveListener(_))
.WillOnce(QuitMainMessageLoop(&message_loop_))
.RetiresOnSaturation();
@@ -60,7 +64,8 @@ TEST_F(LogToServerTest, SendLater) {
InSequence s;
EXPECT_CALL(signal_strategy_, AddListener(_));
EXPECT_CALL(signal_strategy_, GetNextId());
- EXPECT_CALL(signal_strategy_, SendStanza(_));
+ EXPECT_CALL(signal_strategy_, SendStanza(_))
+ .WillOnce(DoAll(DeleteArg<0>(), Return(true)));
EXPECT_CALL(signal_strategy_, RemoveListener(_))
.WillOnce(QuitMainMessageLoop(&message_loop_))
.RetiresOnSaturation();
@@ -77,7 +82,8 @@ TEST_F(LogToServerTest, SendTwoEntriesLater) {
InSequence s;
EXPECT_CALL(signal_strategy_, AddListener(_));
EXPECT_CALL(signal_strategy_, GetNextId());
- EXPECT_CALL(signal_strategy_, SendStanza(_));
+ EXPECT_CALL(signal_strategy_, SendStanza(_))
+ .WillOnce(DoAll(DeleteArg<0>(), Return(true)));
EXPECT_CALL(signal_strategy_, RemoveListener(_))
.WillOnce(QuitMainMessageLoop(&message_loop_))
.RetiresOnSaturation();
« 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