OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_MOCK_URL_FETCHER_FACTORY_H_ | 8 #ifndef GOOGLE_APIS_GAIA_MOCK_URL_FETCHER_FACTORY_H_ |
9 #define CHROME_COMMON_NET_GAIA_MOCK_URL_FETCHER_FACTORY_H_ | 9 #define GOOGLE_APIS_GAIA_MOCK_URL_FETCHER_FACTORY_H_ |
10 | 10 |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 #include "chrome/common/net/gaia/gaia_auth_fetcher.h" | 13 #include "google_apis/gaia/gaia_auth_fetcher.h" |
14 #include "net/url_request/test_url_fetcher_factory.h" | 14 #include "net/url_request/test_url_fetcher_factory.h" |
15 #include "net/url_request/url_request_status.h" | 15 #include "net/url_request/url_request_status.h" |
16 | 16 |
17 // Responds as though ClientLogin returned from the server. | 17 // Responds as though ClientLogin returned from the server. |
18 class MockFetcher : public net::TestURLFetcher { | 18 class MockFetcher : public net::TestURLFetcher { |
19 public: | 19 public: |
20 MockFetcher(bool success, | 20 MockFetcher(bool success, |
21 const GURL& url, | 21 const GURL& url, |
22 const std::string& results, | 22 const std::string& results, |
23 net::URLFetcher::RequestType request_type, | 23 net::URLFetcher::RequestType request_type, |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 } | 60 } |
61 void set_results(const std::string& results) { | 61 void set_results(const std::string& results) { |
62 results_ = results; | 62 results_ = results; |
63 } | 63 } |
64 private: | 64 private: |
65 bool success_; | 65 bool success_; |
66 std::string results_; | 66 std::string results_; |
67 DISALLOW_COPY_AND_ASSIGN(MockURLFetcherFactory); | 67 DISALLOW_COPY_AND_ASSIGN(MockURLFetcherFactory); |
68 }; | 68 }; |
69 | 69 |
70 #endif // CHROME_COMMON_NET_GAIA_MOCK_URL_FETCHER_FACTORY_H_ | 70 #endif // GOOGLE_APIS_GAIA_MOCK_URL_FETCHER_FACTORY_H_ |
OLD | NEW |