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

Side by Side Diff: chrome/browser/chromeos/login/cookie_fetcher_unittest.cc

Issue 8375039: Create a content::UrlFetcher interface that lives in content/public/common and convert users to i... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: review comments Created 9 years, 1 month 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
OLDNEW
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
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
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/cookie_fetcher.cc ('k') | chrome/browser/chromeos/login/image_downloader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698