OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 <math.h> | 5 #include <math.h> |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 | 139 |
140 } // namespace | 140 } // namespace |
141 | 141 |
142 class InputRouterImplTest : public testing::Test { | 142 class InputRouterImplTest : public testing::Test { |
143 public: | 143 public: |
144 InputRouterImplTest() {} | 144 InputRouterImplTest() {} |
145 virtual ~InputRouterImplTest() {} | 145 virtual ~InputRouterImplTest() {} |
146 | 146 |
147 protected: | 147 protected: |
148 // testing::Test | 148 // testing::Test |
149 virtual void SetUp() OVERRIDE { | 149 virtual void SetUp() override { |
150 browser_context_.reset(new TestBrowserContext()); | 150 browser_context_.reset(new TestBrowserContext()); |
151 process_.reset(new MockRenderProcessHost(browser_context_.get())); | 151 process_.reset(new MockRenderProcessHost(browser_context_.get())); |
152 client_.reset(new MockInputRouterClient()); | 152 client_.reset(new MockInputRouterClient()); |
153 ack_handler_.reset(new MockInputAckHandler()); | 153 ack_handler_.reset(new MockInputAckHandler()); |
154 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 154 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
155 command_line->AppendSwitch(switches::kValidateInputEventStream); | 155 command_line->AppendSwitch(switches::kValidateInputEventStream); |
156 input_router_.reset(new InputRouterImpl(process_.get(), | 156 input_router_.reset(new InputRouterImpl(process_.get(), |
157 client_.get(), | 157 client_.get(), |
158 ack_handler_.get(), | 158 ack_handler_.get(), |
159 MSG_ROUTING_NONE, | 159 MSG_ROUTING_NONE, |
160 config_)); | 160 config_)); |
161 client_->set_input_router(input_router()); | 161 client_->set_input_router(input_router()); |
162 ack_handler_->set_input_router(input_router()); | 162 ack_handler_->set_input_router(input_router()); |
163 } | 163 } |
164 | 164 |
165 virtual void TearDown() OVERRIDE { | 165 virtual void TearDown() override { |
166 // Process all pending tasks to avoid leaks. | 166 // Process all pending tasks to avoid leaks. |
167 base::MessageLoop::current()->RunUntilIdle(); | 167 base::MessageLoop::current()->RunUntilIdle(); |
168 | 168 |
169 input_router_.reset(); | 169 input_router_.reset(); |
170 client_.reset(); | 170 client_.reset(); |
171 process_.reset(); | 171 process_.reset(); |
172 browser_context_.reset(); | 172 browser_context_.reset(); |
173 } | 173 } |
174 | 174 |
175 void SetUpForTouchAckTimeoutTest(int timeout_ms) { | 175 void SetUpForTouchAckTimeoutTest(int timeout_ms) { |
(...skipping 1535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1711 client_overscroll = client_->GetAndResetOverscroll(); | 1711 client_overscroll = client_->GetAndResetOverscroll(); |
1712 EXPECT_EQ(wheel_overscroll.accumulated_overscroll, | 1712 EXPECT_EQ(wheel_overscroll.accumulated_overscroll, |
1713 client_overscroll.accumulated_overscroll); | 1713 client_overscroll.accumulated_overscroll); |
1714 EXPECT_EQ(wheel_overscroll.latest_overscroll_delta, | 1714 EXPECT_EQ(wheel_overscroll.latest_overscroll_delta, |
1715 client_overscroll.latest_overscroll_delta); | 1715 client_overscroll.latest_overscroll_delta); |
1716 EXPECT_EQ(wheel_overscroll.current_fling_velocity, | 1716 EXPECT_EQ(wheel_overscroll.current_fling_velocity, |
1717 client_overscroll.current_fling_velocity); | 1717 client_overscroll.current_fling_velocity); |
1718 } | 1718 } |
1719 | 1719 |
1720 } // namespace content | 1720 } // namespace content |
OLD | NEW |