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

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

Issue 2120153003: Remove keyIdentifier. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove_key_identifier_3a
Patch Set: Rebase Created 4 years, 5 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 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 1926 matching lines...) Expand 10 before | Expand all | Expand 10 after
1937 frame->setEditableSelectionOffsets(6, 6); 1937 frame->setEditableSelectionOffsets(6, 6);
1938 EXPECT_TRUE(webView->setComposition("fghij", emptyUnderlines, 0, 5)); 1938 EXPECT_TRUE(webView->setComposition("fghij", emptyUnderlines, 0, 5));
1939 frame->setEditableSelectionOffsets(11, 11); 1939 frame->setEditableSelectionOffsets(11, 11);
1940 verifySelectionAndComposition(webView, 11, 11, 6, 11, "initial case"); 1940 verifySelectionAndComposition(webView, 11, 11, 6, 11, "initial case");
1941 1941
1942 // Press Backspace and verify composition didn't get cancelled. This is to verify the fix 1942 // Press Backspace and verify composition didn't get cancelled. This is to verify the fix
1943 // for crbug.com/429916. 1943 // for crbug.com/429916.
1944 WebKeyboardEvent keyEvent; 1944 WebKeyboardEvent keyEvent;
1945 keyEvent.domKey = Platform::current()->domKeyEnumFromString("\b"); 1945 keyEvent.domKey = Platform::current()->domKeyEnumFromString("\b");
1946 keyEvent.windowsKeyCode = VKEY_BACK; 1946 keyEvent.windowsKeyCode = VKEY_BACK;
1947 keyEvent.setKeyIdentifierFromWindowsKeyCode();
1948 keyEvent.type = WebInputEvent::RawKeyDown; 1947 keyEvent.type = WebInputEvent::RawKeyDown;
1949 webView->handleInputEvent(keyEvent); 1948 webView->handleInputEvent(keyEvent);
1950 1949
1951 frame->setEditableSelectionOffsets(6, 6); 1950 frame->setEditableSelectionOffsets(6, 6);
1952 EXPECT_TRUE(webView->setComposition("fghi", emptyUnderlines, 0, 4)); 1951 EXPECT_TRUE(webView->setComposition("fghi", emptyUnderlines, 0, 4));
1953 frame->setEditableSelectionOffsets(10, 10); 1952 frame->setEditableSelectionOffsets(10, 10);
1954 verifySelectionAndComposition(webView, 10, 10, 6, 10, "after pressing Ba ckspace"); 1953 verifySelectionAndComposition(webView, 10, 10, 6, 10, "after pressing Ba ckspace");
1955 1954
1956 keyEvent.type = WebInputEvent::KeyUp; 1955 keyEvent.type = WebInputEvent::KeyUp;
1957 webView->handleInputEvent(keyEvent); 1956 webView->handleInputEvent(keyEvent);
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
2121 } 2120 }
2122 2121
2123 static void openDateTimeChooser(WebView* webView, HTMLInputElement* inputElement ) 2122 static void openDateTimeChooser(WebView* webView, HTMLInputElement* inputElement )
2124 { 2123 {
2125 inputElement->focus(); 2124 inputElement->focus();
2126 2125
2127 WebKeyboardEvent keyEvent; 2126 WebKeyboardEvent keyEvent;
2128 keyEvent.domKey = Platform::current()->domKeyEnumFromString(" "); 2127 keyEvent.domKey = Platform::current()->domKeyEnumFromString(" ");
2129 keyEvent.windowsKeyCode = VKEY_SPACE; 2128 keyEvent.windowsKeyCode = VKEY_SPACE;
2130 keyEvent.type = WebInputEvent::RawKeyDown; 2129 keyEvent.type = WebInputEvent::RawKeyDown;
2131 keyEvent.setKeyIdentifierFromWindowsKeyCode();
2132 webView->handleInputEvent(keyEvent); 2130 webView->handleInputEvent(keyEvent);
2133 2131
2134 keyEvent.type = WebInputEvent::KeyUp; 2132 keyEvent.type = WebInputEvent::KeyUp;
2135 webView->handleInputEvent(keyEvent); 2133 webView->handleInputEvent(keyEvent);
2136 } 2134 }
2137 2135
2138 // TODO(crbug.com/605112) This test is crashing on Android (Nexus 4) bot. 2136 // TODO(crbug.com/605112) This test is crashing on Android (Nexus 4) bot.
2139 #if OS(ANDROID) 2137 #if OS(ANDROID)
2140 #define MAYBE_ChooseValueFromDateTimeChooser DISABLED_ChooseValueFromDateTimeCho oser 2138 #define MAYBE_ChooseValueFromDateTimeChooser DISABLED_ChooseValueFromDateTimeCho oser
2141 #else 2139 #else
(...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after
2750 WebLocalFrameImpl* frame = toWebLocalFrameImpl(webView->mainFrame()); 2748 WebLocalFrameImpl* frame = toWebLocalFrameImpl(webView->mainFrame());
2751 frame->setAutofillClient(&client); 2749 frame->setAutofillClient(&client);
2752 webView->setInitialFocus(false); 2750 webView->setInitialFocus(false);
2753 2751
2754 EXPECT_EQ(0, client.getUserGestureNotificationsCount()); 2752 EXPECT_EQ(0, client.getUserGestureNotificationsCount());
2755 2753
2756 WebKeyboardEvent keyEvent; 2754 WebKeyboardEvent keyEvent;
2757 keyEvent.domKey = Platform::current()->domKeyEnumFromString(" "); 2755 keyEvent.domKey = Platform::current()->domKeyEnumFromString(" ");
2758 keyEvent.windowsKeyCode = VKEY_SPACE; 2756 keyEvent.windowsKeyCode = VKEY_SPACE;
2759 keyEvent.type = WebInputEvent::RawKeyDown; 2757 keyEvent.type = WebInputEvent::RawKeyDown;
2760 keyEvent.setKeyIdentifierFromWindowsKeyCode();
2761 webView->handleInputEvent(keyEvent); 2758 webView->handleInputEvent(keyEvent);
2762 keyEvent.type = WebInputEvent::KeyUp; 2759 keyEvent.type = WebInputEvent::KeyUp;
2763 webView->handleInputEvent(keyEvent); 2760 webView->handleInputEvent(keyEvent);
2764 2761
2765 EXPECT_EQ(1, client.getUserGestureNotificationsCount()); 2762 EXPECT_EQ(1, client.getUserGestureNotificationsCount());
2766 frame->setAutofillClient(0); 2763 frame->setAutofillClient(0);
2767 } 2764 }
2768 2765
2769 TEST_F(WebViewTest, FirstUserGestureObservedMouseEvent) 2766 TEST_F(WebViewTest, FirstUserGestureObservedMouseEvent)
2770 { 2767 {
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
3132 frame->setAutofillClient(&client); 3129 frame->setAutofillClient(&client);
3133 webView->setInitialFocus(false); 3130 webView->setInitialFocus(false);
3134 3131
3135 EXPECT_TRUE(webView->confirmComposition(WebString::fromUTF8(std::string("hel lo").c_str()))); 3132 EXPECT_TRUE(webView->confirmComposition(WebString::fromUTF8(std::string("hel lo").c_str())));
3136 EXPECT_EQ(1, client.textChangesFromUserGesture()); 3133 EXPECT_EQ(1, client.textChangesFromUserGesture());
3137 EXPECT_FALSE(UserGestureIndicator::processingUserGesture()); 3134 EXPECT_FALSE(UserGestureIndicator::processingUserGesture());
3138 frame->setAutofillClient(0); 3135 frame->setAutofillClient(0);
3139 } 3136 }
3140 3137
3141 } // namespace blink 3138 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/tests/WebPluginContainerTest.cpp ('k') | third_party/WebKit/public/web/WebInputEvent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698