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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/bind.h" | 6 #include "base/bind.h" |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/memory/shared_memory.h" | 9 #include "base/memory/shared_memory.h" |
10 #include "base/timer/timer.h" | 10 #include "base/timer/timer.h" |
(...skipping 2377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2388 | 2388 |
2389 #define TEST_InputRouterRoutes_NOARGS(INPUTMSG) \ | 2389 #define TEST_InputRouterRoutes_NOARGS(INPUTMSG) \ |
2390 TEST_F(RenderWidgetHostTest, InputRouterRoutes##INPUTMSG) { \ | 2390 TEST_F(RenderWidgetHostTest, InputRouterRoutes##INPUTMSG) { \ |
2391 host_->SetupForInputRouterTest(); \ | 2391 host_->SetupForInputRouterTest(); \ |
2392 host_->INPUTMSG(); \ | 2392 host_->INPUTMSG(); \ |
2393 EXPECT_TRUE(host_->mock_input_router()->send_event_called_); \ | 2393 EXPECT_TRUE(host_->mock_input_router()->send_event_called_); \ |
2394 } | 2394 } |
2395 | 2395 |
2396 TEST_InputRouterRoutes_NOARGS(Undo); | 2396 TEST_InputRouterRoutes_NOARGS(Undo); |
2397 TEST_InputRouterRoutes_NOARGS(Redo); | 2397 TEST_InputRouterRoutes_NOARGS(Redo); |
2398 TEST_InputRouterRoutes_NOARGS(Cut); | |
2399 TEST_InputRouterRoutes_NOARGS(Copy); | |
2400 #if defined(OS_MACOSX) | 2398 #if defined(OS_MACOSX) |
2401 TEST_InputRouterRoutes_NOARGS(CopyToFindPboard); | 2399 TEST_InputRouterRoutes_NOARGS(CopyToFindPboard); |
2402 #endif | 2400 #endif |
2403 TEST_InputRouterRoutes_NOARGS(Paste); | |
2404 TEST_InputRouterRoutes_NOARGS(PasteAndMatchStyle); | 2401 TEST_InputRouterRoutes_NOARGS(PasteAndMatchStyle); |
2405 TEST_InputRouterRoutes_NOARGS(Delete); | 2402 TEST_InputRouterRoutes_NOARGS(Delete); |
2406 TEST_InputRouterRoutes_NOARGS(SelectAll); | 2403 TEST_InputRouterRoutes_NOARGS(SelectAll); |
2407 TEST_InputRouterRoutes_NOARGS(Unselect); | 2404 TEST_InputRouterRoutes_NOARGS(Unselect); |
2408 TEST_InputRouterRoutes_NOARGS(Focus); | 2405 TEST_InputRouterRoutes_NOARGS(Focus); |
2409 TEST_InputRouterRoutes_NOARGS(Blur); | 2406 TEST_InputRouterRoutes_NOARGS(Blur); |
2410 TEST_InputRouterRoutes_NOARGS(LostCapture); | 2407 TEST_InputRouterRoutes_NOARGS(LostCapture); |
2411 | 2408 |
2412 #undef TEST_InputRouterRoutes_NOARGS | 2409 #undef TEST_InputRouterRoutes_NOARGS |
2413 | 2410 |
| 2411 #define TEST_InputRouterRoutes_NOARGS_FromRFH(INPUTMSG) \ |
| 2412 TEST_F(RenderWidgetHostTest, InputRouterRoutes##INPUTMSG) { \ |
| 2413 host_->SetupForInputRouterTest(); \ |
| 2414 host_->Send(new INPUTMSG(host_->GetRoutingID())); \ |
| 2415 EXPECT_TRUE(host_->mock_input_router()->send_event_called_); \ |
| 2416 } |
| 2417 |
| 2418 TEST_InputRouterRoutes_NOARGS_FromRFH(InputMsg_Cut); |
| 2419 TEST_InputRouterRoutes_NOARGS_FromRFH(InputMsg_Copy); |
| 2420 TEST_InputRouterRoutes_NOARGS_FromRFH(InputMsg_Paste); |
| 2421 #undef TEST_InputRouterRoutes_NOARGS_FromRFH |
| 2422 |
2414 TEST_F(RenderWidgetHostTest, InputRouterRoutesReplace) { | 2423 TEST_F(RenderWidgetHostTest, InputRouterRoutesReplace) { |
2415 host_->SetupForInputRouterTest(); | 2424 host_->SetupForInputRouterTest(); |
2416 host_->Replace(base::string16()); | 2425 host_->Replace(base::string16()); |
2417 EXPECT_TRUE(host_->mock_input_router()->send_event_called_); | 2426 EXPECT_TRUE(host_->mock_input_router()->send_event_called_); |
2418 } | 2427 } |
2419 | 2428 |
2420 TEST_F(RenderWidgetHostTest, InputRouterRoutesReplaceMisspelling) { | 2429 TEST_F(RenderWidgetHostTest, InputRouterRoutesReplaceMisspelling) { |
2421 host_->SetupForInputRouterTest(); | 2430 host_->SetupForInputRouterTest(); |
2422 host_->ReplaceMisspelling(base::string16()); | 2431 host_->ReplaceMisspelling(base::string16()); |
2423 EXPECT_TRUE(host_->mock_input_router()->send_event_called_); | 2432 EXPECT_TRUE(host_->mock_input_router()->send_event_called_); |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2608 | 2617 |
2609 // Tests RWHI::ForwardTouchEventWithLatencyInfo(). | 2618 // Tests RWHI::ForwardTouchEventWithLatencyInfo(). |
2610 PressTouchPoint(0, 1); | 2619 PressTouchPoint(0, 1); |
2611 SendTouchEvent(); | 2620 SendTouchEvent(); |
2612 CheckLatencyInfoComponentInMessage( | 2621 CheckLatencyInfoComponentInMessage( |
2613 process_, GetLatencyComponentId(), WebInputEvent::TouchStart); | 2622 process_, GetLatencyComponentId(), WebInputEvent::TouchStart); |
2614 SendInputEventACK(WebInputEvent::TouchStart, INPUT_EVENT_ACK_STATE_CONSUMED); | 2623 SendInputEventACK(WebInputEvent::TouchStart, INPUT_EVENT_ACK_STATE_CONSUMED); |
2615 } | 2624 } |
2616 | 2625 |
2617 } // namespace content | 2626 } // namespace content |
OLD | NEW |