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

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

Issue 8416020: Handle additional feedback from http://codereview.chromium.org/8395038/. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' 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 "chrome/browser/chromeos/login/mock_auth_response_handler.h" 5 #include "chrome/browser/chromeos/login/mock_auth_response_handler.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 25 matching lines...) Expand all
36 } 36 }
37 37
38 MockAuthResponseHandler::~MockAuthResponseHandler() {} 38 MockAuthResponseHandler::~MockAuthResponseHandler() {}
39 39
40 void MockAuthResponseHandler::CompleteFetch( 40 void MockAuthResponseHandler::CompleteFetch(
41 content::URLFetcherDelegate* delegate, 41 content::URLFetcherDelegate* delegate,
42 const GURL remote, 42 const GURL remote,
43 const net::URLRequestStatus status, 43 const net::URLRequestStatus status,
44 const int http_response_code, 44 const int http_response_code,
45 const std::string data) { 45 const std::string data) {
46 TestURLFetcher fetcher(0, GURL(), content::URLFetcher::GET, delegate); 46 TestURLFetcher fetcher(0, GURL(), delegate);
47 fetcher.set_url(remote); 47 fetcher.set_url(remote);
48 fetcher.set_status(status); 48 fetcher.set_status(status);
49 fetcher.set_response_code(http_response_code); 49 fetcher.set_response_code(http_response_code);
50 fetcher.SetResponseString(data); 50 fetcher.SetResponseString(data);
51 delegate->OnURLFetchComplete(&fetcher); 51 delegate->OnURLFetchComplete(&fetcher);
52 } 52 }
53 53
54 content::URLFetcher* MockAuthResponseHandler::MockNetwork( 54 content::URLFetcher* MockAuthResponseHandler::MockNetwork(
55 std::string data, 55 std::string data,
56 content::URLFetcherDelegate* delegate) { 56 content::URLFetcherDelegate* delegate) {
57 MessageLoop::current()->PostTask( 57 MessageLoop::current()->PostTask(
58 FROM_HERE, 58 FROM_HERE,
59 base::Bind(MockAuthResponseHandler::CompleteFetch, delegate, remote_, 59 base::Bind(MockAuthResponseHandler::CompleteFetch, delegate, remote_,
60 status_, http_response_code_, data_)); 60 status_, http_response_code_, data_));
61 return content::URLFetcher::Create( 61 return content::URLFetcher::Create(
62 GURL(), content::URLFetcher::GET, delegate); 62 GURL(), content::URLFetcher::GET, delegate);
63 } 63 }
64 64
65 } // namespace chromeos 65 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698