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 #include <errno.h> | 5 #include <errno.h> |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "chrome/browser/chromeos/login/client_login_response_handler.h" | 9 #include "chrome/browser/chromeos/login/client_login_response_handler.h" |
10 #include "chrome/browser/chromeos/login/cookie_fetcher.h" | 10 #include "chrome/browser/chromeos/login/cookie_fetcher.h" |
11 #include "chrome/browser/chromeos/login/issue_response_handler.h" | 11 #include "chrome/browser/chromeos/login/issue_response_handler.h" |
12 #include "chrome/browser/chromeos/login/mock_auth_response_handler.h" | 12 #include "chrome/browser/chromeos/login/mock_auth_response_handler.h" |
13 #include "chrome/common/net/gaia/gaia_urls.h" | 13 #include "chrome/common/net/gaia/gaia_urls.h" |
14 #include "chrome/test/base/testing_profile.h" | 14 #include "chrome/test/base/testing_profile.h" |
15 #include "content/public/common/url_fetcher.h" | 15 #include "content/public/common/url_fetcher.h" |
16 #include "content/test/test_browser_thread.h" | 16 #include "content/test/test_browser_thread.h" |
17 #include "googleurl/src/gurl.h" | 17 #include "googleurl/src/gurl.h" |
18 #include "net/url_request/url_request_status.h" | 18 #include "net/url_request/url_request_status.h" |
19 #include "testing/gmock/include/gmock/gmock.h" | 19 #include "testing/gmock/include/gmock/gmock.h" |
20 #include "testing/gtest/include/gtest/gtest.h" | 20 #include "testing/gtest/include/gtest/gtest.h" |
21 | 21 |
| 22 using content::BrowserThread; |
| 23 |
22 namespace chromeos { | 24 namespace chromeos { |
23 using ::testing::Return; | 25 using ::testing::Return; |
24 using ::testing::Invoke; | 26 using ::testing::Invoke; |
25 using ::testing::Unused; | 27 using ::testing::Unused; |
26 using ::testing::_; | 28 using ::testing::_; |
27 | 29 |
28 class CookieFetcherTest : public testing::Test { | 30 class CookieFetcherTest : public testing::Test { |
29 public: | 31 public: |
30 CookieFetcherTest() | 32 CookieFetcherTest() |
31 : iat_url_(GaiaUrls::GetInstance()->issue_auth_token_url()), | 33 : iat_url_(GaiaUrls::GetInstance()->issue_auth_token_url()), |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 IssueResponseHandler handler(NULL); | 186 IssueResponseHandler handler(NULL); |
185 std::string expected(IssueResponseHandler::BuildTokenAuthUrlWithToken( | 187 std::string expected(IssueResponseHandler::BuildTokenAuthUrlWithToken( |
186 std::string("a\n"))); | 188 std::string("a\n"))); |
187 | 189 |
188 scoped_ptr<content::URLFetcher> fetcher( | 190 scoped_ptr<content::URLFetcher> fetcher( |
189 handler.Handle(std::string("a\n"), NULL)); | 191 handler.Handle(std::string("a\n"), NULL)); |
190 EXPECT_EQ(expected, handler.token_url()); | 192 EXPECT_EQ(expected, handler.token_url()); |
191 } | 193 } |
192 | 194 |
193 } // namespace chromeos | 195 } // namespace chromeos |
OLD | NEW |