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 "google_apis/drive/base_requests.h" | 5 #include "google_apis/drive/base_requests.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 | 30 |
31 class BaseRequestsServerTest : public testing::Test { | 31 class BaseRequestsServerTest : public testing::Test { |
32 protected: | 32 protected: |
33 BaseRequestsServerTest() { | 33 BaseRequestsServerTest() { |
34 } | 34 } |
35 | 35 |
36 void SetUp() override { | 36 void SetUp() override { |
37 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 37 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
38 | 38 |
39 request_context_getter_ = new net::TestURLRequestContextGetter( | 39 request_context_getter_ = new net::TestURLRequestContextGetter( |
40 message_loop_.message_loop_proxy()); | 40 message_loop_.task_runner()); |
41 | 41 |
42 request_sender_.reset(new RequestSender( | 42 request_sender_.reset(new RequestSender( |
43 new DummyAuthService, | 43 new DummyAuthService, |
44 request_context_getter_.get(), | 44 request_context_getter_.get(), |
45 message_loop_.message_loop_proxy(), | 45 message_loop_.task_runner(), |
46 kTestUserAgent)); | 46 kTestUserAgent)); |
47 | 47 |
48 ASSERT_TRUE(test_server_.InitializeAndWaitUntilReady()); | 48 ASSERT_TRUE(test_server_.InitializeAndWaitUntilReady()); |
49 test_server_.RegisterRequestHandler( | 49 test_server_.RegisterRequestHandler( |
50 base::Bind(&test_util::HandleDownloadFileRequest, | 50 base::Bind(&test_util::HandleDownloadFileRequest, |
51 test_server_.base_url(), | 51 test_server_.base_url(), |
52 base::Unretained(&http_request_))); | 52 base::Unretained(&http_request_))); |
53 } | 53 } |
54 | 54 |
55 // Returns a temporary file path suitable for storing the cache file. | 55 // Returns a temporary file path suitable for storing the cache file. |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 run_loop.Run(); | 122 run_loop.Run(); |
123 } | 123 } |
124 EXPECT_EQ(HTTP_NOT_FOUND, result_code); | 124 EXPECT_EQ(HTTP_NOT_FOUND, result_code); |
125 EXPECT_EQ(net::test_server::METHOD_GET, http_request_.method); | 125 EXPECT_EQ(net::test_server::METHOD_GET, http_request_.method); |
126 EXPECT_EQ("/files/gdata/no-such-file.txt", | 126 EXPECT_EQ("/files/gdata/no-such-file.txt", |
127 http_request_.relative_url); | 127 http_request_.relative_url); |
128 // Do not verify the not found message. | 128 // Do not verify the not found message. |
129 } | 129 } |
130 | 130 |
131 } // namespace google_apis | 131 } // namespace google_apis |
OLD | NEW |