forked from crosswalk-project/chromium-crosswalk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move the routing-info inside the jingle element.
Previously, routing info are encoded in the iq node. When the host is offline, the talk network responds with an error IQ that doesn't get relayed to the client because it doesn't have the routing info that the signaling service needs. Since an error IQ always contain the original request, by moving the routing info inside the original jingle request, we can reliably route the error message back to the client. Review-Url: https://codereview.chromium.org/2042513002 Cr-Commit-Position: refs/heads/master@{#398383} (cherry picked from commit 046534d) BUG=618143 Review URL: https://codereview.chromium.org/2061503002 . Cr-Commit-Position: refs/branch-heads/2743@{crosswalk-project#326} Cr-Branched-From: 2b3ae3b-refs/heads/master@{#394939}
- Loading branch information
1 parent
a94f6a6
commit cbc9d49
Showing
2 changed files
with
67 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -403,15 +403,18 @@ TEST(JingleMessageTest, SessionInfo) { | |
buzz::QName("urn:xmpp:jingle:1", "test-info")); | ||
} | ||
|
||
TEST(JingleMessageTest, Address) { | ||
TEST(JingleMessageTest, ParseAddress) { | ||
const char* kTestSessionInfoMessage = | ||
"<cli:iq from='[email protected]' " | ||
"from-channel='lcs' " | ||
"from-endpoint-id='[email protected]/xBrnereror=' " | ||
"to='[email protected]/chromiumsy5C6A652D' type='set' " | ||
"xmlns:cli='jabber:client'><jingle action='session-info' " | ||
"sid='2227053353' xmlns='urn:xmpp:jingle:1'><test-info>TestMessage" | ||
"</test-info></jingle></cli:iq>"; | ||
"to='[email protected]/chromiumsy5C6A652D' type='set' " | ||
"xmlns:cli='jabber:client'>" | ||
"<jingle action='session-info' " | ||
"sid='2227053353' xmlns='urn:xmpp:jingle:1' " | ||
"from-channel='lcs' " | ||
"from-endpoint-id='[email protected]/xBrnereror='>" | ||
"<test-info>TestMessage</test-info>" | ||
"</jingle>" | ||
"</cli:iq>"; | ||
|
||
JingleMessage message; | ||
ParseFormatAndCompare(kTestSessionInfoMessage, &message); | ||
|
@@ -437,9 +440,9 @@ TEST(JingleMessageReplyTest, ToXml) { | |
"</reason></jingle></cli:iq>"; | ||
const char* kTestIncomingMessage2 = | ||
"<cli:iq from='[email protected]' id='4' " | ||
"from-channel='lcs' from-endpoint-id='[email protected]/AbCdEf1234=' " | ||
"to='[email protected]/chromiumsy5C6A652D' type='set' " | ||
"xmlns:cli='jabber:client'><jingle action='session-terminate' " | ||
"from-channel='lcs' from-endpoint-id='[email protected]/AbCdEf1234=' " | ||
"sid='2227053353' xmlns='urn:xmpp:jingle:1'><reason><success/>" | ||
"</reason></jingle></cli:iq>"; | ||
|
||
|
@@ -493,17 +496,17 @@ TEST(JingleMessageReplyTest, ToXml) { | |
kTestIncomingMessage1}, | ||
{JingleMessageReply::INVALID_SID, "ErrorText", | ||
"<iq xmlns='jabber:client' " | ||
"to='[email protected]' to-channel='lcs' " | ||
"to-endpoint-id='[email protected]/AbCdEf1234=' id='4' " | ||
"to='[email protected]' id='4' " | ||
"type='error'><jingle " | ||
"action='session-terminate' sid='2227053353' xmlns='urn:xmpp:jingle:1'>" | ||
"action='session-terminate' sid='2227053353' xmlns='urn:xmpp:jingle:1' " | ||
"from-channel='lcs' from-endpoint-id='[email protected]/AbCdEf1234='>" | ||
"<reason><success/></reason></jingle><error type='modify'>" | ||
"<item-not-found/><text xml:lang='en'>ErrorText</text></error></iq>", | ||
kTestIncomingMessage2}, | ||
{JingleMessageReply::NONE, "", | ||
"<iq xmlns='jabber:client' " | ||
"to='[email protected]' to-channel='lcs' " | ||
"to-endpoint-id='[email protected]/AbCdEf1234=' id='4' type='result'></iq>", | ||
"<iq xmlns='jabber:client' to='[email protected]' id='4' " | ||
"type='result'><jingle xmlns='urn:xmpp:jingle:1' to-channel='lcs' " | ||
"to-endpoint-id='[email protected]/AbCdEf1234='/></iq>", | ||
kTestIncomingMessage2}, | ||
}; | ||
|
||
|
@@ -512,6 +515,7 @@ TEST(JingleMessageReplyTest, ToXml) { | |
XmlElement::ForStr(tests[i].incoming_message)); | ||
ASSERT_TRUE(incoming_message.get()); | ||
|
||
SCOPED_TRACE(testing::Message() << "Running test case: " << i); | ||
JingleMessageReply reply_msg; | ||
if (tests[i].error_text.empty()) { | ||
reply_msg = JingleMessageReply(tests[i].error); | ||
|