| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 OAuth2AccessTokenFetcherImpl. | 5 // A complete set of unit tests for OAuth2AccessTokenFetcherImpl. |
| 6 | 6 |
| 7 #include "google_apis/gaia/oauth2_access_token_fetcher_impl.h" | 7 #include "google_apis/gaia/oauth2_access_token_fetcher_impl.h" |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "net/url_request/url_fetcher.h" | 21 #include "net/url_request/url_fetcher.h" |
| 22 #include "net/url_request/url_fetcher_delegate.h" | 22 #include "net/url_request/url_fetcher_delegate.h" |
| 23 #include "net/url_request/url_fetcher_factory.h" | 23 #include "net/url_request/url_fetcher_factory.h" |
| 24 #include "net/url_request/url_request.h" | 24 #include "net/url_request/url_request.h" |
| 25 #include "net/url_request/url_request_status.h" | 25 #include "net/url_request/url_request_status.h" |
| 26 #include "net/url_request/url_request_test_util.h" | 26 #include "net/url_request/url_request_test_util.h" |
| 27 #include "testing/gmock/include/gmock/gmock.h" | 27 #include "testing/gmock/include/gmock/gmock.h" |
| 28 #include "testing/gtest/include/gtest/gtest.h" | 28 #include "testing/gtest/include/gtest/gtest.h" |
| 29 #include "url/gurl.h" | 29 #include "url/gurl.h" |
| 30 | 30 |
| 31 using net::ResponseCookies; | |
| 32 using net::ScopedURLFetcherFactory; | 31 using net::ScopedURLFetcherFactory; |
| 33 using net::TestURLFetcher; | 32 using net::TestURLFetcher; |
| 34 using net::URLFetcher; | 33 using net::URLFetcher; |
| 35 using net::URLFetcherDelegate; | 34 using net::URLFetcherDelegate; |
| 36 using net::URLFetcherFactory; | 35 using net::URLFetcherFactory; |
| 37 using net::URLRequestStatus; | 36 using net::URLRequestStatus; |
| 38 using testing::_; | 37 using testing::_; |
| 39 using testing::Return; | 38 using testing::Return; |
| 40 | 39 |
| 41 namespace { | 40 namespace { |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 TestURLFetcher url_fetcher(0, GURL("http://www.google.com"), NULL); | 267 TestURLFetcher url_fetcher(0, GURL("http://www.google.com"), NULL); |
| 269 url_fetcher.SetResponseString(kValidFailureTokenResponse); | 268 url_fetcher.SetResponseString(kValidFailureTokenResponse); |
| 270 | 269 |
| 271 std::string error; | 270 std::string error; |
| 272 EXPECT_TRUE( | 271 EXPECT_TRUE( |
| 273 OAuth2AccessTokenFetcherImpl::ParseGetAccessTokenFailureResponse( | 272 OAuth2AccessTokenFetcherImpl::ParseGetAccessTokenFailureResponse( |
| 274 &url_fetcher, &error)); | 273 &url_fetcher, &error)); |
| 275 EXPECT_EQ("invalid_grant", error); | 274 EXPECT_EQ("invalid_grant", error); |
| 276 } | 275 } |
| 277 } | 276 } |
| OLD | NEW |