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 // A collection of classes that are useful when testing things that use a | 5 // A collection of classes that are useful when testing things that use a |
6 // GaiaAuthFetcher. | 6 // GaiaAuthFetcher. |
7 | 7 |
8 #ifndef CHROME_COMMON_NET_GAIA_GAIA_AUTH_FETCHER_UNITTEST_H_ | 8 #ifndef CHROME_COMMON_NET_GAIA_GAIA_AUTH_FETCHER_UNITTEST_H_ |
9 #define CHROME_COMMON_NET_GAIA_GAIA_AUTH_FETCHER_UNITTEST_H_ | 9 #define CHROME_COMMON_NET_GAIA_GAIA_AUTH_FETCHER_UNITTEST_H_ |
10 #pragma once | 10 #pragma once |
(...skipping 24 matching lines...) Expand all Loading... |
35 int response_code, | 35 int response_code, |
36 const net::ResponseCookies& cookies, | 36 const net::ResponseCookies& cookies, |
37 const std::string& results, | 37 const std::string& results, |
38 URLFetcher::RequestType request_type, | 38 URLFetcher::RequestType request_type, |
39 content::URLFetcherDelegate* d); | 39 content::URLFetcherDelegate* d); |
40 | 40 |
41 virtual ~MockFetcher(); | 41 virtual ~MockFetcher(); |
42 | 42 |
43 virtual void Start(); | 43 virtual void Start(); |
44 | 44 |
45 virtual const GURL& url() const; | 45 virtual const GURL& GetUrl() const OVERRIDE; |
46 virtual const net::URLRequestStatus& status() const; | 46 virtual const net::URLRequestStatus& GetStatus() const OVERRIDE; |
47 virtual int response_code() const; | 47 virtual int GetResponseCode() const OVERRIDE; |
48 virtual const net::ResponseCookies& cookies() const; | 48 virtual const net::ResponseCookies& GetCookies() const OVERRIDE; |
49 virtual bool GetResponseAsString(std::string* out_response_string) const; | 49 virtual bool GetResponseAsString(std::string* out_response_string) const; |
50 | 50 |
51 private: | 51 private: |
52 GURL url_; | 52 GURL url_; |
53 net::URLRequestStatus status_; | 53 net::URLRequestStatus status_; |
54 int response_code_; | 54 int response_code_; |
55 net::ResponseCookies cookies_; | 55 net::ResponseCookies cookies_; |
56 std::string results_; | 56 std::string results_; |
57 DISALLOW_COPY_AND_ASSIGN(MockFetcher); | 57 DISALLOW_COPY_AND_ASSIGN(MockFetcher); |
58 }; | 58 }; |
(...skipping 19 matching lines...) Expand all Loading... |
78 void set_results(const std::string& results) { | 78 void set_results(const std::string& results) { |
79 results_ = results; | 79 results_ = results; |
80 } | 80 } |
81 private: | 81 private: |
82 bool success_; | 82 bool success_; |
83 std::string results_; | 83 std::string results_; |
84 DISALLOW_COPY_AND_ASSIGN(MockFactory); | 84 DISALLOW_COPY_AND_ASSIGN(MockFactory); |
85 }; | 85 }; |
86 | 86 |
87 #endif // CHROME_COMMON_NET_GAIA_GAIA_AUTH_FETCHER_UNITTEST_H_ | 87 #endif // CHROME_COMMON_NET_GAIA_GAIA_AUTH_FETCHER_UNITTEST_H_ |
OLD | NEW |