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

Issue 92122: Implements keyboard events for RenderViewTest.... (Closed)

Created:
11 years, 8 months ago by Hironori Bono
Modified:
9 years, 7 months ago
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

Implements keyboard events for RenderViewTest.This change implements a function RenderViewTest::SendKeyEvent() that sends a keyboard event to a RenderView object.To emulate not only US keyboards but also non-US keyboards, this change adds a new class "MockKeyboard", which implements a mapping function from a triple <keyboard type, key code, modifiers> to a Unicode character so that engineers can write RenderViewTest cases without taking care of keyboard types.As samples for this new function, I updated my test RenderViewTest.OnHandleKeyboardEvent and added another test RenderViewTest.InsertCharacters.I wish this class help engineers write more RenderViewTest cases. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=15748

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Patch Set 5 : '' #

Patch Set 6 : '' #

Patch Set 7 : '' #

Total comments: 3

Patch Set 8 : '' #

Patch Set 9 : '' #

Patch Set 10 : '' #

Total comments: 2

Patch Set 11 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+664 lines, -86 lines) Patch
M chrome/chrome.gyp View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
A chrome/renderer/mock_keyboard.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +106 lines, -0 lines 0 comments Download
A chrome/renderer/mock_keyboard.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +47 lines, -0 lines 0 comments Download
A chrome/renderer/mock_keyboard_driver_win.h View 1 chunk +35 lines, -0 lines 0 comments Download
A chrome/renderer/mock_keyboard_driver_win.cc View 1 chunk +140 lines, -0 lines 0 comments Download
M chrome/renderer/render_view.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +3 lines, -0 lines 0 comments Download
M chrome/renderer/render_view_unittest.cc View 1 2 3 4 5 6 7 8 9 10 5 chunks +251 lines, -86 lines 0 comments Download
M chrome/test/render_view_test.h View 1 2 3 4 5 6 7 8 9 10 3 chunks +10 lines, -0 lines 0 comments Download
M chrome/test/render_view_test.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +54 lines, -0 lines 0 comments Download
M chrome/test/unit/unittests.vcproj View 1 2 3 4 5 6 7 8 9 10 1 chunk +16 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Hironori Bono
11 years, 8 months ago (2009-04-28 06:13:56 UTC) #1
brettw
LGTM, just have a few minor suggestions. It looks much nicer! http://codereview.chromium.org/92122/diff/3041/2055 File chrome/renderer/mock_keyboard.h (right): ...
11 years, 8 months ago (2009-04-28 06:46:13 UTC) #2
jungshik at Google
11 years, 7 months ago (2009-05-07 00:11:32 UTC) #3
LGTM. Sorry for the delay.

http://codereview.chromium.org/92122/diff/2103/3060
File chrome/renderer/mock_keyboard.h (right):

http://codereview.chromium.org/92122/diff/2103/3060#newcode86
Line 86: // layout, key code, and modifiers.
I'm aware that you changed the out param to a string to support a non-BMP
character on Windows. I wonder if it's always a single Unicode character. I
guess not.  

Aha. I saw your comment in other files. Perhaps, it's better to move that here
and explain about |output| and |length| here.

http://codereview.chromium.org/92122/diff/2103/3060#newcode95
Line 95: MockKeyboardWin driver_;
nit: I was a little confused with the relationship between MockKeyboard and
MockKeyboardWin class. Wouldn't it be better to use a name that won't be
mistaken for a class inheritance relation. I don't have a good name, but how
about MockKeyboardDriverFoo (Win, Mac and Linux)?

Powered by Google App Engine
This is Rietveld 408576698