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 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/message_loop.h" | 10 #include "base/message_loop.h" |
11 #include "base/stringprintf.h" | 11 #include "base/stringprintf.h" |
12 #include "chrome/common/net/gaia/gaia_auth_consumer.h" | 12 #include "chrome/common/net/gaia/gaia_auth_consumer.h" |
13 #include "chrome/common/net/gaia/gaia_auth_fetcher.h" | 13 #include "chrome/common/net/gaia/gaia_auth_fetcher.h" |
14 #include "chrome/common/net/gaia/gaia_auth_fetcher_unittest.h" | 14 #include "chrome/common/net/gaia/gaia_auth_fetcher_unittest.h" |
15 #include "chrome/common/net/gaia/google_service_auth_error.h" | 15 #include "chrome/common/net/gaia/google_service_auth_error.h" |
16 #include "chrome/common/net/http_return.h" | 16 #include "chrome/common/net/http_return.h" |
17 #include "chrome/common/net/test_url_fetcher_factory.h" | |
18 #include "chrome/common/net/url_fetcher.h" | |
19 #include "chrome/test/testing_profile.h" | 17 #include "chrome/test/testing_profile.h" |
| 18 #include "content/common/test_url_fetcher_factory.h" |
| 19 #include "content/common/url_fetcher.h" |
20 #include "googleurl/src/gurl.h" | 20 #include "googleurl/src/gurl.h" |
21 #include "net/base/net_errors.h" | 21 #include "net/base/net_errors.h" |
22 #include "net/url_request/url_request_status.h" | 22 #include "net/url_request/url_request_status.h" |
23 #include "testing/gmock/include/gmock/gmock.h" | 23 #include "testing/gmock/include/gmock/gmock.h" |
24 #include "testing/gtest/include/gtest/gtest.h" | 24 #include "testing/gtest/include/gtest/gtest.h" |
25 | 25 |
26 using ::testing::_; | 26 using ::testing::_; |
27 | 27 |
28 MockFetcher::MockFetcher(bool success, | 28 MockFetcher::MockFetcher(bool success, |
29 const GURL& url, | 29 const GURL& url, |
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 EXPECT_TRUE(auth.HasPendingFetch()); | 488 EXPECT_TRUE(auth.HasPendingFetch()); |
489 auth.OnURLFetchComplete( | 489 auth.OnURLFetchComplete( |
490 NULL, | 490 NULL, |
491 issue_auth_token_source_, | 491 issue_auth_token_source_, |
492 net::URLRequestStatus(net::URLRequestStatus::SUCCESS, 0), | 492 net::URLRequestStatus(net::URLRequestStatus::SUCCESS, 0), |
493 RC_FORBIDDEN, | 493 RC_FORBIDDEN, |
494 cookies_, | 494 cookies_, |
495 ""); | 495 ""); |
496 EXPECT_FALSE(auth.HasPendingFetch()); | 496 EXPECT_FALSE(auth.HasPendingFetch()); |
497 } | 497 } |
OLD | NEW |