summaryrefslogtreecommitdiffstats
path: root/jingle/notifier
diff options
context:
space:
mode:
authorsergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-22 19:49:21 +0000
committersergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-22 19:49:21 +0000
commit71a0c6be93d9303fcdcf7a6f7f99201a0fa41618 (patch)
tree3dcc118a2e8296be5230f373e4939c73f69d6821 /jingle/notifier
parente101fc3da10d9ac1ab490ae13adbd5d25e74eb9a (diff)
downloadchromium_src-71a0c6be93d9303fcdcf7a6f7f99201a0fa41618.zip
chromium_src-71a0c6be93d9303fcdcf7a6f7f99201a0fa41618.tar.gz
chromium_src-71a0c6be93d9303fcdcf7a6f7f99201a0fa41618.tar.bz2
Changes needed to roll libjingle r141 to chrome.
1. Setting ice username and password for P2PTransportChannel. 2. Updating XMPP Auth cookie with Auth Token Review URL: https://chromiumcodereview.appspot.com/10382003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@138334 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'jingle/notifier')
-rw-r--r--jingle/notifier/base/gaia_token_pre_xmpp_auth.cc11
-rw-r--r--jingle/notifier/base/gaia_token_pre_xmpp_auth.h7
-rw-r--r--jingle/notifier/base/notifier_options_util.cc3
-rw-r--r--jingle/notifier/base/xmpp_connection_unittest.cc13
-rw-r--r--jingle/notifier/communicator/single_login_attempt.cc2
5 files changed, 24 insertions, 12 deletions
diff --git a/jingle/notifier/base/gaia_token_pre_xmpp_auth.cc b/jingle/notifier/base/gaia_token_pre_xmpp_auth.cc
index 5e22667..36e1688 100644
--- a/jingle/notifier/base/gaia_token_pre_xmpp_auth.cc
+++ b/jingle/notifier/base/gaia_token_pre_xmpp_auth.cc
@@ -69,7 +69,8 @@ void GaiaTokenPreXmppAuth::StartPreXmppAuth(
const buzz::Jid& jid,
const talk_base::SocketAddress& server,
const talk_base::CryptString& pass,
- const std::string& auth_cookie) {
+ const std::string& auth_mechanism,
+ const std::string& auth_token) {
SignalAuthDone();
}
@@ -93,8 +94,12 @@ buzz::CaptchaChallenge GaiaTokenPreXmppAuth::GetCaptchaChallenge() const {
return buzz::CaptchaChallenge();
}
-std::string GaiaTokenPreXmppAuth::GetAuthCookie() const {
- return std::string();
+std::string GaiaTokenPreXmppAuth::GetAuthToken() const {
+ return token_;
+}
+
+std::string GaiaTokenPreXmppAuth::GetAuthMechanism() const {
+ return auth_mechanism_;
}
std::string GaiaTokenPreXmppAuth::ChooseBestSaslMechanism(
diff --git a/jingle/notifier/base/gaia_token_pre_xmpp_auth.h b/jingle/notifier/base/gaia_token_pre_xmpp_auth.h
index a2f98f7..6abf3a6 100644
--- a/jingle/notifier/base/gaia_token_pre_xmpp_auth.h
+++ b/jingle/notifier/base/gaia_token_pre_xmpp_auth.h
@@ -30,7 +30,8 @@ class GaiaTokenPreXmppAuth : public buzz::PreXmppAuth {
virtual void StartPreXmppAuth(const buzz::Jid& jid,
const talk_base::SocketAddress& server,
const talk_base::CryptString& pass,
- const std::string& auth_cookie) OVERRIDE;
+ const std::string& auth_mechanism,
+ const std::string& auth_token) OVERRIDE;
virtual bool IsAuthDone() const OVERRIDE;
@@ -42,7 +43,9 @@ class GaiaTokenPreXmppAuth : public buzz::PreXmppAuth {
virtual buzz::CaptchaChallenge GetCaptchaChallenge() const OVERRIDE;
- virtual std::string GetAuthCookie() const OVERRIDE;
+ virtual std::string GetAuthToken() const OVERRIDE;
+
+ virtual std::string GetAuthMechanism() const OVERRIDE;
// buzz::SaslHandler implementation.
diff --git a/jingle/notifier/base/notifier_options_util.cc b/jingle/notifier/base/notifier_options_util.cc
index 67620a0..93bd173 100644
--- a/jingle/notifier/base/notifier_options_util.cc
+++ b/jingle/notifier/base/notifier_options_util.cc
@@ -7,6 +7,7 @@
#include "base/logging.h"
#include "jingle/notifier/base/const_communicator.h"
#include "jingle/notifier/base/notifier_options.h"
+#include "talk/xmpp/constants.h"
#include "talk/xmpp/jid.h"
namespace notifier {
@@ -23,7 +24,7 @@ buzz::XmppClientSettings MakeXmppClientSettings(
xmpp_client_settings.set_resource("chrome-sync");
xmpp_client_settings.set_host(jid.domain());
xmpp_client_settings.set_use_tls(buzz::TLS_ENABLED);
- xmpp_client_settings.set_auth_cookie(
+ xmpp_client_settings.set_auth_token(buzz::AUTH_MECHANISM_GOOGLE_TOKEN,
notifier_options.invalidate_xmpp_login ?
token + "bogus" : token);
xmpp_client_settings.set_token_service("chromiumsync");
diff --git a/jingle/notifier/base/xmpp_connection_unittest.cc b/jingle/notifier/base/xmpp_connection_unittest.cc
index 1c37bde..e410378 100644
--- a/jingle/notifier/base/xmpp_connection_unittest.cc
+++ b/jingle/notifier/base/xmpp_connection_unittest.cc
@@ -47,17 +47,19 @@ class MockPreXmppAuth : public buzz::PreXmppAuth {
std::string(const std::vector<std::string>&, bool));
MOCK_METHOD1(CreateSaslMechanism,
buzz::SaslMechanism*(const std::string&));
- MOCK_METHOD4(StartPreXmppAuth,
+ MOCK_METHOD5(StartPreXmppAuth,
void(const buzz::Jid&,
const talk_base::SocketAddress&,
const talk_base::CryptString&,
+ const std::string&,
const std::string&));
MOCK_CONST_METHOD0(IsAuthDone, bool());
MOCK_CONST_METHOD0(IsAuthorized, bool());
MOCK_CONST_METHOD0(HadError, bool());
MOCK_CONST_METHOD0(GetError, int());
MOCK_CONST_METHOD0(GetCaptchaChallenge, buzz::CaptchaChallenge());
- MOCK_CONST_METHOD0(GetAuthCookie, std::string());
+ MOCK_CONST_METHOD0(GetAuthToken, std::string());
+ MOCK_CONST_METHOD0(GetAuthMechanism, std::string());
};
class MockXmppConnectionDelegate : public XmppConnection::Delegate {
@@ -113,7 +115,7 @@ TEST_F(XmppConnectionTest, ImmediateFailure) {
}
TEST_F(XmppConnectionTest, PreAuthFailure) {
- EXPECT_CALL(*mock_pre_xmpp_auth_, StartPreXmppAuth(_, _, _, _));
+ EXPECT_CALL(*mock_pre_xmpp_auth_, StartPreXmppAuth(_, _, _, _,_));
EXPECT_CALL(*mock_pre_xmpp_auth_, IsAuthDone()).WillOnce(Return(true));
EXPECT_CALL(*mock_pre_xmpp_auth_, IsAuthorized()).WillOnce(Return(false));
EXPECT_CALL(*mock_pre_xmpp_auth_, HadError()).WillOnce(Return(true));
@@ -132,10 +134,11 @@ TEST_F(XmppConnectionTest, PreAuthFailure) {
}
TEST_F(XmppConnectionTest, FailureAfterPreAuth) {
- EXPECT_CALL(*mock_pre_xmpp_auth_, StartPreXmppAuth(_, _, _, _));
+ EXPECT_CALL(*mock_pre_xmpp_auth_, StartPreXmppAuth(_, _, _, _,_));
EXPECT_CALL(*mock_pre_xmpp_auth_, IsAuthDone()).WillOnce(Return(true));
EXPECT_CALL(*mock_pre_xmpp_auth_, IsAuthorized()).WillOnce(Return(true));
- EXPECT_CALL(*mock_pre_xmpp_auth_, GetAuthCookie()).WillOnce(Return(""));
+ EXPECT_CALL(*mock_pre_xmpp_auth_, GetAuthMechanism()).WillOnce(Return(""));
+ EXPECT_CALL(*mock_pre_xmpp_auth_, GetAuthToken()).WillOnce(Return(""));
EXPECT_CALL(mock_xmpp_connection_delegate_,
OnError(buzz::XmppEngine::ERROR_NONE, 0, NULL));
diff --git a/jingle/notifier/communicator/single_login_attempt.cc b/jingle/notifier/communicator/single_login_attempt.cc
index dfaa03a..b4cae89 100644
--- a/jingle/notifier/communicator/single_login_attempt.cc
+++ b/jingle/notifier/communicator/single_login_attempt.cc
@@ -157,7 +157,7 @@ void SingleLoginAttempt::TryConnect(
buzz::STR_EMPTY);
buzz::PreXmppAuth* pre_xmpp_auth =
new GaiaTokenPreXmppAuth(
- jid.Str(), client_settings.auth_cookie(),
+ jid.Str(), client_settings.auth_token(),
client_settings.token_service(),
login_settings_.auth_mechanism());
xmpp_connection_.reset(