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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 cf->AttemptFetch(client_login_data_); | 169 cf->AttemptFetch(client_login_data_); |
170 message_loop_.RunAllPending(); | 170 message_loop_.RunAllPending(); |
171 } | 171 } |
172 | 172 |
173 TEST_F(CookieFetcherTest, ClientLoginResponseHandlerTest) { | 173 TEST_F(CookieFetcherTest, ClientLoginResponseHandlerTest) { |
174 ClientLoginResponseHandler handler(NULL); | 174 ClientLoginResponseHandler handler(NULL); |
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<content::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 expected(IssueResponseHandler::BuildTokenAuthUrlWithToken( | 185 std::string expected(IssueResponseHandler::BuildTokenAuthUrlWithToken( |
186 std::string("a\n"))); | 186 std::string("a\n"))); |
187 | 187 |
188 scoped_ptr<URLFetcher> fetcher(handler.Handle(std::string("a\n"), NULL)); | 188 scoped_ptr<content::URLFetcher> fetcher( |
| 189 handler.Handle(std::string("a\n"), NULL)); |
189 EXPECT_EQ(expected, handler.token_url()); | 190 EXPECT_EQ(expected, handler.token_url()); |
190 } | 191 } |
191 | 192 |
192 } // namespace chromeos | 193 } // namespace chromeos |
OLD | NEW |