OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "chrome/browser/google_apis/base_requests.h" | 5 #include "chrome/browser/google_apis/base_requests.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 } | 36 } |
37 | 37 |
38 virtual void SetUp() OVERRIDE { | 38 virtual void SetUp() OVERRIDE { |
39 profile_.reset(new TestingProfile); | 39 profile_.reset(new TestingProfile); |
40 | 40 |
41 request_context_getter_ = new net::TestURLRequestContextGetter( | 41 request_context_getter_ = new net::TestURLRequestContextGetter( |
42 message_loop_.message_loop_proxy()); | 42 message_loop_.message_loop_proxy()); |
43 | 43 |
44 request_sender_.reset(new RequestSender(profile_.get(), | 44 request_sender_.reset(new RequestSender(profile_.get(), |
45 request_context_getter_.get(), | 45 request_context_getter_.get(), |
| 46 message_loop_.message_loop_proxy(), |
46 std::vector<std::string>(), | 47 std::vector<std::string>(), |
47 kTestUserAgent)); | 48 kTestUserAgent)); |
48 request_sender_->auth_service()->set_access_token_for_testing( | 49 request_sender_->auth_service()->set_access_token_for_testing( |
49 kTestAuthToken); | 50 kTestAuthToken); |
50 | 51 |
51 ASSERT_TRUE(test_server_.InitializeAndWaitUntilReady()); | 52 ASSERT_TRUE(test_server_.InitializeAndWaitUntilReady()); |
52 test_server_.RegisterRequestHandler( | 53 test_server_.RegisterRequestHandler( |
53 base::Bind(&test_util::HandleDownloadFileRequest, | 54 base::Bind(&test_util::HandleDownloadFileRequest, |
54 test_server_.base_url(), | 55 test_server_.base_url(), |
55 base::Unretained(&http_request_))); | 56 base::Unretained(&http_request_))); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 run_loop.Run(); | 126 run_loop.Run(); |
126 } | 127 } |
127 EXPECT_EQ(HTTP_NOT_FOUND, result_code); | 128 EXPECT_EQ(HTTP_NOT_FOUND, result_code); |
128 EXPECT_EQ(net::test_server::METHOD_GET, http_request_.method); | 129 EXPECT_EQ(net::test_server::METHOD_GET, http_request_.method); |
129 EXPECT_EQ("/files/gdata/no-such-file.txt", | 130 EXPECT_EQ("/files/gdata/no-such-file.txt", |
130 http_request_.relative_url); | 131 http_request_.relative_url); |
131 // Do not verify the not found message. | 132 // Do not verify the not found message. |
132 } | 133 } |
133 | 134 |
134 } // namespace google_apis | 135 } // namespace google_apis |
OLD | NEW |