OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/test_runner/event_sender.h" | 5 #include "components/test_runner/event_sender.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 1378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1389 needs_shift_key_modifier = true; | 1389 needs_shift_key_modifier = true; |
1390 } | 1390 } |
1391 } | 1391 } |
1392 | 1392 |
1393 // For one generated keyboard event, we need to generate a keyDown/keyUp | 1393 // For one generated keyboard event, we need to generate a keyDown/keyUp |
1394 // pair; | 1394 // pair; |
1395 // On Windows, we might also need to generate a char event to mimic the | 1395 // On Windows, we might also need to generate a char event to mimic the |
1396 // Windows event flow; on other platforms we create a merged event and test | 1396 // Windows event flow; on other platforms we create a merged event and test |
1397 // the event flow that that platform provides. | 1397 // the event flow that that platform provides. |
1398 WebKeyboardEvent event_down; | 1398 WebKeyboardEvent event_down; |
| 1399 event_down.timeStampSeconds = GetCurrentEventTimeSec(); |
1399 event_down.type = WebInputEvent::RawKeyDown; | 1400 event_down.type = WebInputEvent::RawKeyDown; |
1400 event_down.modifiers = modifiers; | 1401 event_down.modifiers = modifiers; |
1401 event_down.windowsKeyCode = code; | 1402 event_down.windowsKeyCode = code; |
1402 event_down.domCode = static_cast<int>( | 1403 event_down.domCode = static_cast<int>( |
1403 ui::KeycodeConverter::CodeStringToDomCode(domString.c_str())); | 1404 ui::KeycodeConverter::CodeStringToDomCode(domString.c_str())); |
1404 | 1405 |
1405 if (generate_char) { | 1406 if (generate_char) { |
1406 event_down.text[0] = text; | 1407 event_down.text[0] = text; |
1407 event_down.unmodifiedText[0] = text; | 1408 event_down.unmodifiedText[0] = text; |
1408 } | 1409 } |
(...skipping 1153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2562 | 2563 |
2563 bool EventSender::HandleInputEventOnViewOrPopup(const WebInputEvent& event) { | 2564 bool EventSender::HandleInputEventOnViewOrPopup(const WebInputEvent& event) { |
2564 if (WebPagePopup* popup = view_->pagePopup()) { | 2565 if (WebPagePopup* popup = view_->pagePopup()) { |
2565 if (!WebInputEvent::isKeyboardEventType(event.type)) | 2566 if (!WebInputEvent::isKeyboardEventType(event.type)) |
2566 return popup->handleInputEvent(event); | 2567 return popup->handleInputEvent(event); |
2567 } | 2568 } |
2568 return view_->handleInputEvent(event); | 2569 return view_->handleInputEvent(event); |
2569 } | 2570 } |
2570 | 2571 |
2571 } // namespace test_runner | 2572 } // namespace test_runner |
OLD | NEW |