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

Unified Diff: remoting/signaling/fake_signal_strategy.h

Issue 2417913002: Process incoming IQs in the same order that they were sent. (Closed)
Patch Set: Reviewer's feedback 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
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..f9c893bf3d6ba899949fd04ee42375410f98c295 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);
+ // Simulates packet reordering by reorering the last session-info message and
+ // the first transport-info message in a multi-stepped auth.
+ 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,10 @@ class FakeSignalStrategy : public SignalStrategy,
base::TimeDelta send_delay_;
+ bool simulate_reorder_ = false;
+ std::unique_ptr<buzz::XmlElement> pending_session_info_;
+ int session_info_counts_ = 0;
+
// All received messages, includes thouse still in |pending_messages_|.
std::list<buzz::XmlElement*> received_messages_;

Powered by Google App Engine
This is Rietveld 408576698