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

Unified Diff: remoting/jingle_glue/mock_objects.h

Issue 8432009: Refactor IqRequest. (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
Index: remoting/jingle_glue/mock_objects.h
diff --git a/remoting/jingle_glue/mock_objects.h b/remoting/jingle_glue/mock_objects.h
index 5563e22c15f326fdc542a37f6fb0c9b65d1b3dbd..aad9697ae639f201ba472700165b940b9fd342e3 100644
--- a/remoting/jingle_glue/mock_objects.h
+++ b/remoting/jingle_glue/mock_objects.h
@@ -3,7 +3,7 @@
// found in the LICENSE file.
#include "base/memory/scoped_ptr.h"
-#include "remoting/jingle_glue/iq_request.h"
+#include "remoting/jingle_glue/iq_sender.h"
#include "remoting/jingle_glue/signal_strategy.h"
#include "testing/gmock/include/gmock/gmock.h"
@@ -16,36 +16,11 @@ class MockSignalStrategy : public SignalStrategy {
MOCK_METHOD1(Init, void(StatusObserver*));
MOCK_METHOD0(Close, void());
- MOCK_METHOD1(SetListener, void(Listener* listener));
- MOCK_METHOD1(SendStanza, void(buzz::XmlElement* stanza));
+ MOCK_METHOD1(AddListener, void(Listener* listener));
+ MOCK_METHOD1(RemoveListener, void(Listener* listener));
+ MOCK_METHOD1(SendStanza, bool(buzz::XmlElement* stanza));
MOCK_METHOD0(GetNextId, std::string());
MOCK_METHOD0(CreateIqRequest, IqRequest*());
};
-class MockIqRequest : public IqRequest {
- public:
- MockIqRequest();
- virtual ~MockIqRequest();
-
- MOCK_METHOD1(SendIq, void(buzz::XmlElement* stanza));
- MOCK_METHOD1(set_callback, void(const IqRequest::ReplyCallback&));
-
- // Ensure this takes ownership of the pointer, as the real IqRequest object
- // would, to avoid memory-leak.
- void set_callback_hook(const IqRequest::ReplyCallback& callback) {
- callback_ = callback;
- }
-
- void Init() {
- ON_CALL(*this, set_callback(testing::_))
- .WillByDefault(testing::Invoke(
- this, &MockIqRequest::set_callback_hook));
- }
-
- ReplyCallback& callback() { return callback_; }
-
- private:
- ReplyCallback callback_;
-};
-
} // namespace remoting

Powered by Google App Engine
This is Rietveld 408576698