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

Unified Diff: Source/web/tests/WebInputEventConversionTest.cpp

Issue 663523002: Adding support for DOM3 KeyboardEvents Code in KeyboardEvents (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added new embedder API and code review comments update Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: Source/web/tests/WebInputEventConversionTest.cpp
diff --git a/Source/web/tests/WebInputEventConversionTest.cpp b/Source/web/tests/WebInputEventConversionTest.cpp
index fa506bcd4c0578ea5fc6d718c8d50c630f6b3c6f..9f87882aa19e3a308ef514ae5482be125fe69b2f 100644
--- a/Source/web/tests/WebInputEventConversionTest.cpp
+++ b/Source/web/tests/WebInputEventConversionTest.cpp
@@ -57,13 +57,24 @@ namespace {
PassRefPtrWillBeRawPtr<KeyboardEvent> createKeyboardEventWithLocation(KeyboardEvent::KeyLocationCode location)
{
- return KeyboardEvent::create("keydown", true, true, 0, "", location, false, false, false, false);
+ return KeyboardEvent::create("keydown", true, true, 0, "", "", location, false, false, false, false);
}
int getModifiersForKeyLocationCode(KeyboardEvent::KeyLocationCode location)
{
+ const std::string baseURL("http://www.test0.com/");
+ const std::string fileName("fixed_layout.html");
+
+ URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(baseURL.c_str()), WebString::fromUTF8("fixed_layout.html"));
+ FrameTestHelpers::WebViewHelper webViewHelper;
+ WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(baseURL + fileName, true);
Wez 2015/01/17 02:35:10 Do you need to tear this page down somewhere? It
bokan 2015/01/20 17:05:58 Ditto here
Habib Virji 2015/01/22 16:01:30 Acknowledged.
+ int pageWidth = 640;
+ int pageHeight = 480;
+ webViewImpl->resize(WebSize(pageWidth, pageHeight));
+ webViewImpl->layout();
+
RefPtrWillBeRawPtr<KeyboardEvent> event = createKeyboardEventWithLocation(location);
- WebKeyboardEventBuilder convertedEvent(*event);
+ WebKeyboardEventBuilder convertedEvent(toLocalFrame(webViewImpl->page()->mainFrame())->view(), *event);
return convertedEvent.modifiers;
}

Powered by Google App Engine
This is Rietveld 408576698