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/message_loop.h" | 11 #include "base/message_loop.h" |
12 #include "base/stringprintf.h" | 12 #include "base/strings/stringprintf.h" |
13 #include "base/values.h" | 13 #include "base/values.h" |
14 #include "chrome/test/base/testing_profile.h" | 14 #include "chrome/test/base/testing_profile.h" |
15 #include "google_apis/gaia/gaia_auth_consumer.h" | 15 #include "google_apis/gaia/gaia_auth_consumer.h" |
16 #include "google_apis/gaia/gaia_auth_fetcher.h" | 16 #include "google_apis/gaia/gaia_auth_fetcher.h" |
17 #include "google_apis/gaia/gaia_urls.h" | 17 #include "google_apis/gaia/gaia_urls.h" |
18 #include "google_apis/gaia/google_service_auth_error.h" | 18 #include "google_apis/gaia/google_service_auth_error.h" |
19 #include "google_apis/gaia/mock_url_fetcher_factory.h" | 19 #include "google_apis/gaia/mock_url_fetcher_factory.h" |
20 #include "google_apis/google_api_keys.h" | 20 #include "google_apis/google_api_keys.h" |
21 #include "googleurl/src/gurl.h" | 21 #include "googleurl/src/gurl.h" |
22 #include "net/base/load_flags.h" | 22 #include "net/base/load_flags.h" |
(...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
805 .Times(1); | 805 .Times(1); |
806 | 806 |
807 GaiaAuthFetcher auth(&consumer, std::string(), | 807 GaiaAuthFetcher auth(&consumer, std::string(), |
808 profile_.GetRequestContext()); | 808 profile_.GetRequestContext()); |
809 net::URLRequestStatus status(net::URLRequestStatus::SUCCESS, 0); | 809 net::URLRequestStatus status(net::URLRequestStatus::SUCCESS, 0); |
810 MockFetcher mock_fetcher( | 810 MockFetcher mock_fetcher( |
811 oauth_login_gurl_, status, net::HTTP_OK, cookies_, data, | 811 oauth_login_gurl_, status, net::HTTP_OK, cookies_, data, |
812 net::URLFetcher::GET, &auth); | 812 net::URLFetcher::GET, &auth); |
813 auth.OnURLFetchComplete(&mock_fetcher); | 813 auth.OnURLFetchComplete(&mock_fetcher); |
814 } | 814 } |
OLD | NEW |