Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(533)

Side by Side Diff: components/test_runner/event_sender.cc

Issue 1353943002: event_sender should include a timeStamp when dispatching keyboard events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698