| 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 |
| 11 | 11 |
| 12 #include <string> | 12 #include <string> |
| 13 | 13 |
| 14 #include "chrome/common/net/gaia/gaia_auth_fetcher.h" | 14 #include "chrome/common/net/gaia/gaia_auth_fetcher.h" |
| 15 #include "chrome/common/net/url_fetcher.h" | |
| 16 #include "chrome/common/net/http_return.h" | 15 #include "chrome/common/net/http_return.h" |
| 16 #include "content/common/url_fetcher.h" |
| 17 #include "net/url_request/url_request_status.h" | 17 #include "net/url_request/url_request_status.h" |
| 18 | 18 |
| 19 // Responds as though ClientLogin returned from the server. | 19 // Responds as though ClientLogin returned from the server. |
| 20 class MockFetcher : public URLFetcher { | 20 class MockFetcher : public URLFetcher { |
| 21 public: | 21 public: |
| 22 MockFetcher(bool success, | 22 MockFetcher(bool success, |
| 23 const GURL& url, | 23 const GURL& url, |
| 24 const std::string& results, | 24 const std::string& results, |
| 25 URLFetcher::RequestType request_type, | 25 URLFetcher::RequestType request_type, |
| 26 URLFetcher::Delegate* d); | 26 URLFetcher::Delegate* d); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 54 void set_results(const std::string& results) { | 54 void set_results(const std::string& results) { |
| 55 results_ = results; | 55 results_ = results; |
| 56 } | 56 } |
| 57 private: | 57 private: |
| 58 bool success_; | 58 bool success_; |
| 59 std::string results_; | 59 std::string results_; |
| 60 DISALLOW_COPY_AND_ASSIGN(MockFactory); | 60 DISALLOW_COPY_AND_ASSIGN(MockFactory); |
| 61 }; | 61 }; |
| 62 | 62 |
| 63 #endif // CHROME_COMMON_NET_GAIA_GAIA_AUTH_FETCHER_UNITTEST_H_ | 63 #endif // CHROME_COMMON_NET_GAIA_GAIA_AUTH_FETCHER_UNITTEST_H_ |
| OLD | NEW |