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 #include "google_apis/gaia/ubertoken_fetcher.h" | 5 #include "google_apis/gaia/ubertoken_fetcher.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
11 #include "base/thread_task_runner_handle.h" | 11 #include "base/threading/thread_task_runner_handle.h" |
12 #include "google_apis/gaia/fake_oauth2_token_service.h" | 12 #include "google_apis/gaia/fake_oauth2_token_service.h" |
13 #include "google_apis/gaia/gaia_constants.h" | 13 #include "google_apis/gaia/gaia_constants.h" |
14 #include "net/url_request/test_url_fetcher_factory.h" | 14 #include "net/url_request/test_url_fetcher_factory.h" |
15 #include "net/url_request/url_request_test_util.h" | 15 #include "net/url_request/url_request_test_util.h" |
16 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
17 | 17 |
18 namespace { | 18 namespace { |
19 | 19 |
20 const char kTestAccountId[] = "test@gmail.com"; | 20 const char kTestAccountId[] = "test@gmail.com"; |
21 | 21 |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 EXPECT_EQ(0, consumer_.nb_error_); | 162 EXPECT_EQ(0, consumer_.nb_error_); |
163 EXPECT_EQ(0, consumer_.nb_correct_token_); | 163 EXPECT_EQ(0, consumer_.nb_correct_token_); |
164 EXPECT_EQ("", consumer_.last_token_); | 164 EXPECT_EQ("", consumer_.last_token_); |
165 | 165 |
166 fetcher_->OnGetTokenSuccess(NULL, "accessToken", base::Time()); | 166 fetcher_->OnGetTokenSuccess(NULL, "accessToken", base::Time()); |
167 fetcher_->OnUberAuthTokenSuccess("uberToken"); | 167 fetcher_->OnUberAuthTokenSuccess("uberToken"); |
168 EXPECT_EQ(0, consumer_.nb_error_); | 168 EXPECT_EQ(0, consumer_.nb_error_); |
169 EXPECT_EQ(1, consumer_.nb_correct_token_); | 169 EXPECT_EQ(1, consumer_.nb_correct_token_); |
170 EXPECT_EQ("uberToken", consumer_.last_token_); | 170 EXPECT_EQ("uberToken", consumer_.last_token_); |
171 } | 171 } |
OLD | NEW |