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

Side by Side Diff: third_party/WebKit/Source/web/tests/WebInputEventConversionTest.cpp

Issue 2454073005: Add isComposing support for KeyboardEvents (Closed)
Patch Set: Fix windows and linux Created 4 years, 1 month 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 | « third_party/WebKit/Source/core/events/KeyboardEventInit.idl ('k') | 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 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 #include "public/web/WebSettings.h" 49 #include "public/web/WebSettings.h"
50 #include "testing/gtest/include/gtest/gtest.h" 50 #include "testing/gtest/include/gtest/gtest.h"
51 #include "web/WebLocalFrameImpl.h" 51 #include "web/WebLocalFrameImpl.h"
52 #include "web/WebViewImpl.h" 52 #include "web/WebViewImpl.h"
53 #include "web/tests/FrameTestHelpers.h" 53 #include "web/tests/FrameTestHelpers.h"
54 54
55 namespace blink { 55 namespace blink {
56 56
57 KeyboardEvent* createKeyboardEventWithLocation( 57 KeyboardEvent* createKeyboardEventWithLocation(
58 KeyboardEvent::KeyLocationCode location) { 58 KeyboardEvent::KeyLocationCode location) {
59 return KeyboardEvent::create("keydown", true, true, 0, "", "", location, 59 KeyboardEventInit keyEventInit;
60 PlatformEvent::NoModifiers, 0); 60 keyEventInit.setBubbles(true);
61 keyEventInit.setCancelable(true);
62 keyEventInit.setLocation(location);
63 return new KeyboardEvent("keydown", keyEventInit);
61 } 64 }
62 65
63 int getModifiersForKeyLocationCode(KeyboardEvent::KeyLocationCode location) { 66 int getModifiersForKeyLocationCode(KeyboardEvent::KeyLocationCode location) {
64 KeyboardEvent* event = createKeyboardEventWithLocation(location); 67 KeyboardEvent* event = createKeyboardEventWithLocation(location);
65 WebKeyboardEventBuilder convertedEvent(*event); 68 WebKeyboardEventBuilder convertedEvent(*event);
66 return convertedEvent.modifiers; 69 return convertedEvent.modifiers;
67 } 70 }
68 71
69 TEST(WebInputEventConversionTest, WebKeyboardEventBuilder) { 72 TEST(WebInputEventConversionTest, WebKeyboardEventBuilder) {
70 // Test key location conversion. 73 // Test key location conversion.
(...skipping 1173 matching lines...) Expand 10 before | Expand all | Expand 10 after
1244 EXPECT_EQ(ScrollInertialPhaseNonMomentum, 1247 EXPECT_EQ(ScrollInertialPhaseNonMomentum,
1245 platformGestureBuilder.inertialPhase()); 1248 platformGestureBuilder.inertialPhase());
1246 EXPECT_TRUE(platformGestureBuilder.synthetic()); 1249 EXPECT_TRUE(platformGestureBuilder.synthetic());
1247 EXPECT_EQ(ScrollGranularity::ScrollByPage, 1250 EXPECT_EQ(ScrollGranularity::ScrollByPage,
1248 platformGestureBuilder.deltaUnits()); 1251 platformGestureBuilder.deltaUnits());
1249 EXPECT_EQ(12345U, platformGestureBuilder.uniqueTouchEventId()); 1252 EXPECT_EQ(12345U, platformGestureBuilder.uniqueTouchEventId());
1250 } 1253 }
1251 } 1254 }
1252 1255
1253 } // namespace blink 1256 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/events/KeyboardEventInit.idl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698