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

Side by Side Diff: content/browser/renderer_host/web_input_event_aura_unittest.cc

Issue 1124383005: Exclude unsupported keycodes from X11 tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 | tools/valgrind/gtest_exclude/content_unittests.gtest.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "content/browser/renderer_host/web_input_event_aura.h" 5 #include "content/browser/renderer_host/web_input_event_aura.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 #include "ui/events/event.h" 9 #include "ui/events/event.h"
10 #include "ui/events/event_utils.h" 10 #include "ui/events/event_utils.h"
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 << "{dom_code:" 188 << "{dom_code:"
189 << ui::KeycodeConverter::DomCodeToCodeString(test_case.dom_code) 189 << ui::KeycodeConverter::DomCodeToCodeString(test_case.dom_code)
190 << ", ui_keycode:" << test_case.ui_keycode 190 << ", ui_keycode:" << test_case.ui_keycode
191 << "}, expect: " << test_case.expected_result; 191 << "}, expect: " << test_case.expected_result;
192 } 192 }
193 #if defined(USE_X11) 193 #if defined(USE_X11)
194 ui::ScopedXI2Event xev; 194 ui::ScopedXI2Event xev;
195 for (size_t i = 0; i < arraysize(kTesCases); ++i) { 195 for (size_t i = 0; i < arraysize(kTesCases); ++i) {
196 const TestCase& test_case = kTesCases[i]; 196 const TestCase& test_case = kTesCases[i];
197 197
198 // TODO: re-enable the two cases excluded here once all trybots
199 // are sufficiently up to date to round-trip the associated keys.
200 if ((test_case.x_keysym == XK_KP_Divide) ||
201 (test_case.x_keysym == XK_KP_Decimal))
202 continue;
203
198 xev.InitKeyEvent(ui::ET_KEY_PRESSED, test_case.ui_keycode, ui::EF_NONE); 204 xev.InitKeyEvent(ui::ET_KEY_PRESSED, test_case.ui_keycode, ui::EF_NONE);
199 XEvent* xevent = xev; 205 XEvent* xevent = xev;
200 xevent->xkey.keycode = 206 xevent->xkey.keycode =
201 XKeysymToKeycode(gfx::GetXDisplay(), test_case.x_keysym); 207 XKeysymToKeycode(gfx::GetXDisplay(), test_case.x_keysym);
202 if (!xevent->xkey.keycode) 208 if (!xevent->xkey.keycode)
203 continue; 209 continue;
204 ui::KeyEvent event(xev); 210 ui::KeyEvent event(xev);
205 blink::WebKeyboardEvent webkit_event = MakeWebKeyboardEvent(event); 211 blink::WebKeyboardEvent webkit_event = MakeWebKeyboardEvent(event);
206 EXPECT_EQ(test_case.expected_result, 212 EXPECT_EQ(test_case.expected_result,
207 (webkit_event.modifiers & blink::WebInputEvent::IsKeyPad) != 0) 213 (webkit_event.modifiers & blink::WebInputEvent::IsKeyPad) != 0)
208 << "Failed in " << i << "th test case: " 214 << "Failed in " << i << "th test case: "
209 << "{dom_code:" 215 << "{dom_code:"
210 << ui::KeycodeConverter::DomCodeToCodeString(test_case.dom_code) 216 << ui::KeycodeConverter::DomCodeToCodeString(test_case.dom_code)
211 << ", ui_keycode:" << test_case.ui_keycode 217 << ", ui_keycode:" << test_case.ui_keycode
212 << ", x_keysym:" << test_case.x_keysym 218 << ", x_keysym:" << test_case.x_keysym
213 << "}, expect: " << test_case.expected_result; 219 << "}, expect: " << test_case.expected_result;
214 } 220 }
215 #endif 221 #endif
216 } 222 }
217 223
218 } // namespace content 224 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | tools/valgrind/gtest_exclude/content_unittests.gtest.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698