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

Side by Side Diff: chrome/common/net/test_url_fetcher_factory.cc

Issue 6166010: net: Remove typedef net::URLRequestStatus URLRequestStatus; (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 months 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
« no previous file with comments | « chrome/common/net/gaia/gaia_auth_fetcher_unittest.cc ('k') | chrome/common/net/url_fetcher.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 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/common/net/test_url_fetcher_factory.h" 5 #include "chrome/common/net/test_url_fetcher_factory.h"
6
6 #include <string> 7 #include <string>
7 8
8 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
9 #include "base/message_loop.h" 10 #include "base/message_loop.h"
10 #include "net/url_request/url_request_status.h" 11 #include "net/url_request/url_request_status.h"
11 12
12 TestURLFetcher::TestURLFetcher(int id, 13 TestURLFetcher::TestURLFetcher(int id,
13 const GURL& url, 14 const GURL& url,
14 URLFetcher::RequestType request_type, 15 URLFetcher::RequestType request_type,
15 URLFetcher::Delegate* d) 16 URLFetcher::Delegate* d)
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 method_factory_.NewRunnableMethod(&FakeURLFetcher::RunDelegate)); 61 method_factory_.NewRunnableMethod(&FakeURLFetcher::RunDelegate));
61 } 62 }
62 63
63 private: 64 private:
64 virtual ~FakeURLFetcher() { 65 virtual ~FakeURLFetcher() {
65 } 66 }
66 67
67 // This is the method which actually calls the delegate that is passed in the 68 // This is the method which actually calls the delegate that is passed in the
68 // constructor. 69 // constructor.
69 void RunDelegate() { 70 void RunDelegate() {
70 URLRequestStatus status; 71 net::URLRequestStatus status;
71 status.set_status(success_ ? URLRequestStatus::SUCCESS : 72 status.set_status(success_ ? net::URLRequestStatus::SUCCESS :
72 URLRequestStatus::FAILED); 73 net::URLRequestStatus::FAILED);
73 delegate()->OnURLFetchComplete(this, url_, status, success_ ? 200 : 500, 74 delegate()->OnURLFetchComplete(this, url_, status, success_ ? 200 : 500,
74 ResponseCookies(), response_data_); 75 ResponseCookies(), response_data_);
75 } 76 }
76 77
77 // Pre-baked response data and flag which indicates whether the request should 78 // Pre-baked response data and flag which indicates whether the request should
78 // be successful or not. 79 // be successful or not.
79 GURL url_; 80 GURL url_;
80 std::string response_data_; 81 std::string response_data_;
81 bool success_; 82 bool success_;
82 83
(...skipping 21 matching lines...) Expand all
104 void FakeURLFetcherFactory::SetFakeResponse(const std::string& url, 105 void FakeURLFetcherFactory::SetFakeResponse(const std::string& url,
105 const std::string& response_data, 106 const std::string& response_data,
106 bool success) { 107 bool success) {
107 // Overwrite existing URL if it already exists. 108 // Overwrite existing URL if it already exists.
108 fake_responses_[GURL(url)] = std::make_pair(response_data, success); 109 fake_responses_[GURL(url)] = std::make_pair(response_data, success);
109 } 110 }
110 111
111 void FakeURLFetcherFactory::ClearFakeReponses() { 112 void FakeURLFetcherFactory::ClearFakeReponses() {
112 fake_responses_.clear(); 113 fake_responses_.clear();
113 } 114 }
OLDNEW
« no previous file with comments | « chrome/common/net/gaia/gaia_auth_fetcher_unittest.cc ('k') | chrome/common/net/url_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698