OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #include <string> | 5 #include <string> |
6 | 6 |
7 #include "base/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
8 #include "chrome/browser/signin/oauth2_token_service.h" | 8 #include "chrome/browser/signin/oauth2_token_service.h" |
9 #include "chrome/browser/signin/oauth2_token_service_test_util.h" | 9 #include "chrome/browser/signin/oauth2_token_service_test_util.h" |
10 #include "chrome/browser/signin/token_service_factory.h" | 10 #include "chrome/browser/signin/token_service_factory.h" |
11 #include "chrome/browser/signin/token_service_unittest.h" | 11 #include "chrome/browser/signin/token_service_unittest.h" |
12 #include "chrome/common/chrome_notification_types.h" | 12 #include "chrome/common/chrome_notification_types.h" |
13 #include "chrome/test/base/testing_browser_process.h" | 13 #include "chrome/test/base/testing_browser_process.h" |
14 #include "google_apis/gaia/gaia_constants.h" | 14 #include "google_apis/gaia/gaia_constants.h" |
15 #include "google_apis/gaia/google_service_auth_error.h" | 15 #include "google_apis/gaia/google_service_auth_error.h" |
16 #include "google_apis/gaia/oauth2_access_token_consumer.h" | 16 #include "google_apis/gaia/oauth2_access_token_consumer.h" |
17 #include "net/http/http_status_code.h" | 17 #include "net/http/http_status_code.h" |
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 EXPECT_EQ(0, consumer_.number_of_errors_); | 462 EXPECT_EQ(0, consumer_.number_of_errors_); |
463 fetcher = factory_.GetFetcherByID(0); | 463 fetcher = factory_.GetFetcherByID(0); |
464 EXPECT_TRUE(fetcher); | 464 EXPECT_TRUE(fetcher); |
465 fetcher->set_response_code(net::HTTP_OK); | 465 fetcher->set_response_code(net::HTTP_OK); |
466 fetcher->SetResponseString(GetValidTokenResponse("token2", 3600)); | 466 fetcher->SetResponseString(GetValidTokenResponse("token2", 3600)); |
467 fetcher->delegate()->OnURLFetchComplete(fetcher); | 467 fetcher->delegate()->OnURLFetchComplete(fetcher); |
468 EXPECT_EQ(3, consumer_.number_of_successful_tokens_); | 468 EXPECT_EQ(3, consumer_.number_of_successful_tokens_); |
469 EXPECT_EQ(0, consumer_.number_of_errors_); | 469 EXPECT_EQ(0, consumer_.number_of_errors_); |
470 EXPECT_EQ("token2", consumer_.last_token_); | 470 EXPECT_EQ("token2", consumer_.last_token_); |
471 } | 471 } |
OLD | NEW |