OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <errno.h> | 5 #include <errno.h> |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "chrome/browser/chromeos/login/client_login_response_handler.h" | 9 #include "chrome/browser/chromeos/login/client_login_response_handler.h" |
10 #include "chrome/browser/chromeos/login/cookie_fetcher.h" | 10 #include "chrome/browser/chromeos/login/cookie_fetcher.h" |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 std::string input("a\nb\n"); | 175 std::string input("a\nb\n"); |
176 std::string expected("a&b&"); | 176 std::string expected("a&b&"); |
177 expected.append(ClientLoginResponseHandler::kService); | 177 expected.append(ClientLoginResponseHandler::kService); |
178 | 178 |
179 scoped_ptr<URLFetcher> fetcher(handler.Handle(input, NULL)); | 179 scoped_ptr<URLFetcher> fetcher(handler.Handle(input, NULL)); |
180 EXPECT_EQ(expected, handler.payload()); | 180 EXPECT_EQ(expected, handler.payload()); |
181 } | 181 } |
182 | 182 |
183 TEST_F(CookieFetcherTest, IssueResponseHandlerTest) { | 183 TEST_F(CookieFetcherTest, IssueResponseHandlerTest) { |
184 IssueResponseHandler handler(NULL); | 184 IssueResponseHandler handler(NULL); |
185 std::string input("a\n"); | 185 std::string expected(IssueResponseHandler::BuildTokenAuthUrlWithToken( |
186 std::string expected(GaiaUrls::GetInstance()->token_auth_url()); | 186 std::string("a\n"))); |
187 expected.append(input); | |
188 | 187 |
189 scoped_ptr<URLFetcher> fetcher(handler.Handle(input, NULL)); | 188 scoped_ptr<URLFetcher> fetcher(handler.Handle(std::string("a\n"), NULL)); |
190 EXPECT_EQ(expected, handler.token_url()); | 189 EXPECT_EQ(expected, handler.token_url()); |
191 } | 190 } |
192 | 191 |
193 } // namespace chromeos | 192 } // namespace chromeos |
OLD | NEW |