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

Unified Diff: remoting/signaling/fake_signal_strategy.h

Issue 2417913002: Process incoming IQs in the same order that they were sent. (Closed)
Patch Set: Rebase Created 4 years, 2 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 | « remoting/protocol/jingle_session_unittest.cc ('k') | remoting/signaling/fake_signal_strategy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/signaling/fake_signal_strategy.h
diff --git a/remoting/signaling/fake_signal_strategy.h b/remoting/signaling/fake_signal_strategy.h
index b828a2e2847559ba331a28b28b9bb42dc87fb82e..d18092c2848f516c4f2e00a6817b4d833195287f 100644
--- a/remoting/signaling/fake_signal_strategy.h
+++ b/remoting/signaling/fake_signal_strategy.h
@@ -45,6 +45,10 @@ class FakeSignalStrategy : public SignalStrategy,
void SetLocalJid(const std::string& jid);
+ // Simulate IQ messages re-ordering by swapping the delivery order of
+ // next pair of messages.
+ void SimulatePackgeReordering();
+
// SignalStrategy interface.
void Connect() override;
void Disconnect() override;
@@ -67,6 +71,7 @@ class FakeSignalStrategy : public SignalStrategy,
// Called by the |peer_|. Takes ownership of |stanza|.
void OnIncomingMessage(std::unique_ptr<buzz::XmlElement> stanza);
+ void NotifyListeners(std::unique_ptr<buzz::XmlElement> stanza);
void SetPeerCallback(const PeerCallback& peer_callback);
scoped_refptr<base::SingleThreadTaskRunner> main_thread_;
@@ -79,6 +84,9 @@ class FakeSignalStrategy : public SignalStrategy,
base::TimeDelta send_delay_;
+ bool simulate_reorder_ = false;
+ std::unique_ptr<buzz::XmlElement> pending_stanza_;
+
// All received messages, includes thouse still in |pending_messages_|.
std::list<buzz::XmlElement*> received_messages_;
« no previous file with comments | « remoting/protocol/jingle_session_unittest.cc ('k') | remoting/signaling/fake_signal_strategy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698