OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 EntryActionCallback callback_; | 49 EntryActionCallback callback_; |
50 GURL url_; | 50 GURL url_; |
51 }; | 51 }; |
52 | 52 |
53 } // namespace | 53 } // namespace |
54 | 54 |
55 class BaseRequestsTest : public testing::Test { | 55 class BaseRequestsTest : public testing::Test { |
56 public: | 56 public: |
57 BaseRequestsTest() : response_code_(net::HTTP_OK) {} | 57 BaseRequestsTest() : response_code_(net::HTTP_OK) {} |
58 | 58 |
59 virtual void SetUp() override { | 59 void SetUp() override { |
60 request_context_getter_ = new net::TestURLRequestContextGetter( | 60 request_context_getter_ = new net::TestURLRequestContextGetter( |
61 message_loop_.message_loop_proxy()); | 61 message_loop_.message_loop_proxy()); |
62 | 62 |
63 sender_.reset(new RequestSender(new DummyAuthService, | 63 sender_.reset(new RequestSender(new DummyAuthService, |
64 request_context_getter_.get(), | 64 request_context_getter_.get(), |
65 message_loop_.message_loop_proxy(), | 65 message_loop_.message_loop_proxy(), |
66 std::string() /* custom user agent */)); | 66 std::string() /* custom user agent */)); |
67 | 67 |
68 ASSERT_TRUE(test_server_.InitializeAndWaitUntilReady()); | 68 ASSERT_TRUE(test_server_.InitializeAndWaitUntilReady()); |
69 test_server_.RegisterRequestHandler( | 69 test_server_.RegisterRequestHandler( |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 test_util::CreateQuitCallback( | 129 test_util::CreateQuitCallback( |
130 &run_loop, test_util::CreateCopyResultCallback(&error)), | 130 &run_loop, test_util::CreateCopyResultCallback(&error)), |
131 test_server_.base_url())); | 131 test_server_.base_url())); |
132 run_loop.Run(); | 132 run_loop.Run(); |
133 | 133 |
134 // HTTP_FORBIDDEN (403) is overridden by the error reason. | 134 // HTTP_FORBIDDEN (403) is overridden by the error reason. |
135 EXPECT_EQ(HTTP_SERVICE_UNAVAILABLE, error); | 135 EXPECT_EQ(HTTP_SERVICE_UNAVAILABLE, error); |
136 } | 136 } |
137 | 137 |
138 } // namespace google_apis | 138 } // namespace google_apis |
OLD | NEW |