OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "remoting/host/gcd_rest_client.h" | 5 #include "remoting/host/gcd_rest_client.h" |
6 | 6 |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "base/test/simple_test_clock.h" | 9 #include "base/test/simple_test_clock.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
11 #include "net/url_request/test_url_fetcher_factory.h" | 11 #include "net/url_request/test_url_fetcher_factory.h" |
12 #include "remoting/host/fake_oauth_token_getter.h" | 12 #include "remoting/base/fake_oauth_token_getter.h" |
13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
14 | 14 |
15 namespace remoting { | 15 namespace remoting { |
16 | 16 |
17 class GcdRestClientTest : public testing::Test { | 17 class GcdRestClientTest : public testing::Test { |
18 public: | 18 public: |
19 GcdRestClientTest() | 19 GcdRestClientTest() |
20 : default_token_getter_(OAuthTokenGetter::SUCCESS, | 20 : default_token_getter_(OAuthTokenGetter::SUCCESS, |
21 "<fake_user_email>", | 21 "<fake_user_email>", |
22 "<fake_access_token>") {} | 22 "<fake_access_token>") {} |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 "\"requestTimeMs\":0.0}", | 148 "\"requestTimeMs\":0.0}", |
149 fetcher->upload_data()); | 149 fetcher->upload_data()); |
150 EXPECT_EQ("application/json", fetcher->upload_content_type()); | 150 EXPECT_EQ("application/json", fetcher->upload_content_type()); |
151 fetcher->set_response_code(200); | 151 fetcher->set_response_code(200); |
152 fetcher->delegate()->OnURLFetchComplete(fetcher); | 152 fetcher->delegate()->OnURLFetchComplete(fetcher); |
153 EXPECT_EQ(1, counter_); | 153 EXPECT_EQ(1, counter_); |
154 EXPECT_EQ(GcdRestClient::SUCCESS, last_result_); | 154 EXPECT_EQ(GcdRestClient::SUCCESS, last_result_); |
155 } | 155 } |
156 | 156 |
157 } // namespace remoting | 157 } // namespace remoting |
OLD | NEW |