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

Side by Side Diff: chrome/browser/sync/engine/net/gaia_authenticator_unittest.cc

Issue 194065: Initial commit of sync engine code to browser/sync.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Fixes to gtest include path, reverted syncapi. Created 11 years, 3 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 unified diff | Download patch | Annotate | Revision Log
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/sync/engine/net/gaia_authenticator.h"
6
7 #include <string>
8
9 #include "chrome/browser/sync/engine/net/http_return.h"
10 #include "chrome/browser/sync/util/sync_types.h"
11 #include "googleurl/src/gurl.h"
12 #include "testing/gtest/include/gtest/gtest.h"
13
14 using std::string;
15
16 namespace browser_sync {
17
18 class GaiaAuthenticatorTest : public testing::Test { };
19
20 class GaiaAuthMock : public GaiaAuthenticator {
21 public:
22 GaiaAuthMock() : GaiaAuthenticator("useragent",
23 "serviceid",
24 "http://gaia_url") {}
25 ~GaiaAuthMock() {}
26 protected:
27 bool Post(const GURL& url, const string& post_body,
28 unsigned long* response_code, string* response_body) {
29 *response_code = RC_REQUEST_OK;
30 response_body->assign("body\n");
31 return true;
32 }
33 };
34
35 TEST(GaiaAuthenticatorTest, TestNewlineAtEndOfAuthTokenRemoved) {
36 GaiaAuthMock mock_auth;
37 GaiaAuthenticator::AuthResults results;
38 EXPECT_TRUE(mock_auth.IssueAuthToken(&results, "sid", true));
39 EXPECT_EQ(0, results.auth_token.compare("body"));
40 }
41
42 } // namespace browser_sync
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698