diff options
author | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-23 12:06:19 +0000 |
---|---|---|
committer | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-23 12:06:19 +0000 |
commit | cff2764267289815ebab479e962d066706ccdcac (patch) | |
tree | 5b8149ed2cde6f99f1368fa086972f8bc5db23a8 /remoting/jingle_glue/mock_objects.h | |
parent | 4513eb18159fb35272cd619785a3b8295b4a6467 (diff) | |
download | chromium_src-cff2764267289815ebab479e962d066706ccdcac.zip chromium_src-cff2764267289815ebab479e962d066706ccdcac.tar.gz chromium_src-cff2764267289815ebab479e962d066706ccdcac.tar.bz2 |
Use scoped_ptr to pass ownership in SignalStrategy.
Updated SignalStrategy and some other code where we pass ownership of
XML objects.
Review URL: http://codereview.chromium.org/9453001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@123222 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/jingle_glue/mock_objects.h')
-rw-r--r-- | remoting/jingle_glue/mock_objects.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/remoting/jingle_glue/mock_objects.h b/remoting/jingle_glue/mock_objects.h index 61bc2d3..01d7117 100644 --- a/remoting/jingle_glue/mock_objects.h +++ b/remoting/jingle_glue/mock_objects.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -6,6 +6,7 @@ #include "remoting/jingle_glue/iq_sender.h" #include "remoting/jingle_glue/signal_strategy.h" #include "testing/gmock/include/gmock/gmock.h" +#include "third_party/libjingle/source/talk/xmllite/xmlelement.h" namespace remoting { @@ -20,8 +21,14 @@ class MockSignalStrategy : public SignalStrategy { MOCK_CONST_METHOD0(GetLocalJid, std::string()); MOCK_METHOD1(AddListener, void(Listener* listener)); MOCK_METHOD1(RemoveListener, void(Listener* listener)); - MOCK_METHOD1(SendStanza, bool(buzz::XmlElement* stanza)); MOCK_METHOD0(GetNextId, std::string()); + + // GMock currently doesn't support move-only arguments, so we have + // to use this hack here. + MOCK_METHOD1(SendStanzaPtr, bool(buzz::XmlElement* stanza)); + virtual bool SendStanza(scoped_ptr<buzz::XmlElement> stanza) OVERRIDE { + return SendStanzaPtr(stanza.release()); + } }; } // namespace remoting |