| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/sync/engine/net/gaia_authenticator.h" | 5 #include "chrome/browser/sync/engine/net/gaia_authenticator.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "chrome/browser/sync/engine/net/http_return.h" | 9 #include "chrome/browser/sync/engine/net/http_return.h" |
| 10 #include "chrome/browser/sync/util/sync_types.h" | 10 #include "chrome/browser/sync/util/sync_types.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 bool Post(const GURL& url, const string& post_body, | 27 bool Post(const GURL& url, const string& post_body, |
| 28 unsigned long* response_code, string* response_body) { | 28 unsigned long* response_code, string* response_body) { |
| 29 *response_code = RC_REQUEST_OK; | 29 *response_code = RC_REQUEST_OK; |
| 30 response_body->assign("body\n"); | 30 response_body->assign("body\n"); |
| 31 return true; | 31 return true; |
| 32 } | 32 } |
| 33 }; | 33 }; |
| 34 | 34 |
| 35 TEST(GaiaAuthenticatorTest, TestNewlineAtEndOfAuthTokenRemoved) { | 35 TEST(GaiaAuthenticatorTest, TestNewlineAtEndOfAuthTokenRemoved) { |
| 36 GaiaAuthMock mock_auth; | 36 GaiaAuthMock mock_auth; |
| 37 MessageLoop message_loop; |
| 38 mock_auth.set_message_loop(&message_loop); |
| 37 GaiaAuthenticator::AuthResults results; | 39 GaiaAuthenticator::AuthResults results; |
| 38 EXPECT_TRUE(mock_auth.IssueAuthToken(&results, "sid", true)); | 40 EXPECT_TRUE(mock_auth.IssueAuthToken(&results, "sid", true)); |
| 39 EXPECT_EQ(0, results.auth_token.compare("body")); | 41 EXPECT_EQ(0, results.auth_token.compare("body")); |
| 40 } | 42 } |
| 41 | 43 |
| 42 } // namespace browser_sync | 44 } // namespace browser_sync |
| OLD | NEW |