| 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 17 matching lines...) Expand all Loading... |
| 28 MockFetcher(const GURL& url, | 28 MockFetcher(const GURL& url, |
| 29 const net::URLRequestStatus& status, | 29 const net::URLRequestStatus& status, |
| 30 int response_code, | 30 int response_code, |
| 31 const net::ResponseCookies& cookies, | 31 const net::ResponseCookies& cookies, |
| 32 const std::string& results, | 32 const std::string& results, |
| 33 content::URLFetcher::RequestType request_type, | 33 content::URLFetcher::RequestType request_type, |
| 34 content::URLFetcherDelegate* d); | 34 content::URLFetcherDelegate* d); |
| 35 | 35 |
| 36 virtual ~MockFetcher(); | 36 virtual ~MockFetcher(); |
| 37 | 37 |
| 38 virtual void Start(); | 38 virtual void Start() OVERRIDE; |
| 39 | 39 |
| 40 private: | 40 private: |
| 41 DISALLOW_COPY_AND_ASSIGN(MockFetcher); | 41 DISALLOW_COPY_AND_ASSIGN(MockFetcher); |
| 42 }; | 42 }; |
| 43 | 43 |
| 44 template<typename T> | 44 template<typename T> |
| 45 class MockFactory : public content::URLFetcherFactory, | 45 class MockFactory : public content::URLFetcherFactory, |
| 46 public ScopedURLFetcherFactory { | 46 public ScopedURLFetcherFactory { |
| 47 public: | 47 public: |
| 48 MockFactory() | 48 MockFactory() |
| (...skipping 14 matching lines...) Expand all Loading... |
| 63 void set_results(const std::string& results) { | 63 void set_results(const std::string& results) { |
| 64 results_ = results; | 64 results_ = results; |
| 65 } | 65 } |
| 66 private: | 66 private: |
| 67 bool success_; | 67 bool success_; |
| 68 std::string results_; | 68 std::string results_; |
| 69 DISALLOW_COPY_AND_ASSIGN(MockFactory); | 69 DISALLOW_COPY_AND_ASSIGN(MockFactory); |
| 70 }; | 70 }; |
| 71 | 71 |
| 72 #endif // CHROME_COMMON_NET_GAIA_GAIA_AUTH_FETCHER_UNITTEST_H_ | 72 #endif // CHROME_COMMON_NET_GAIA_GAIA_AUTH_FETCHER_UNITTEST_H_ |
| OLD | NEW |