| 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 complete set of unit tests for GaiaAuthFetcher. | 5 // A complete set of unit tests for GaiaAuthFetcher. |
| 6 // Originally ported from GoogleAuthenticator tests. | 6 // Originally ported from GoogleAuthenticator tests. |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/message_loop/message_loop.h" |
| 12 #include "base/strings/stringprintf.h" | 13 #include "base/strings/stringprintf.h" |
| 13 #include "base/values.h" | 14 #include "base/values.h" |
| 14 #include "build/build_config.h" | 15 #include "build/build_config.h" |
| 15 #include "google_apis/gaia/gaia_auth_consumer.h" | 16 #include "google_apis/gaia/gaia_auth_consumer.h" |
| 16 #include "google_apis/gaia/gaia_auth_fetcher.h" | 17 #include "google_apis/gaia/gaia_auth_fetcher.h" |
| 17 #include "google_apis/gaia/gaia_urls.h" | 18 #include "google_apis/gaia/gaia_urls.h" |
| 18 #include "google_apis/gaia/google_service_auth_error.h" | 19 #include "google_apis/gaia/google_service_auth_error.h" |
| 19 #include "google_apis/gaia/mock_url_fetcher_factory.h" | 20 #include "google_apis/gaia/mock_url_fetcher_factory.h" |
| 20 #include "google_apis/google_api_keys.h" | 21 #include "google_apis/google_api_keys.h" |
| 21 #include "net/base/load_flags.h" | 22 #include "net/base/load_flags.h" |
| (...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 746 | 747 |
| 747 GaiaAuthFetcher auth(&consumer, std::string(), GetRequestContext()); | 748 GaiaAuthFetcher auth(&consumer, std::string(), GetRequestContext()); |
| 748 auth.StartGetTokenResponse(std::string(), std::string(), std::string()); | 749 auth.StartGetTokenResponse(std::string(), std::string(), std::string()); |
| 749 | 750 |
| 750 net::URLRequestStatus status(net::URLRequestStatus::SUCCESS, 0); | 751 net::URLRequestStatus status(net::URLRequestStatus::SUCCESS, 0); |
| 751 MockFetcher mock_fetcher(GaiaUrls::GetInstance()->oauth2_iframe_url(), status, | 752 MockFetcher mock_fetcher(GaiaUrls::GetInstance()->oauth2_iframe_url(), status, |
| 752 net::HTTP_OK, kGetTokenPairValidResponse, | 753 net::HTTP_OK, kGetTokenPairValidResponse, |
| 753 net::URLFetcher::GET, &auth); | 754 net::URLFetcher::GET, &auth); |
| 754 auth.OnURLFetchComplete(&mock_fetcher); | 755 auth.OnURLFetchComplete(&mock_fetcher); |
| 755 } | 756 } |
| OLD | NEW |