Index: Source/web/tests/KeyboardTest.cpp |
diff --git a/Source/web/tests/KeyboardTest.cpp b/Source/web/tests/KeyboardTest.cpp |
index f33d651d499fb456e6072b8420f8e2b3548251b7..b11c97375b4c1070b315432d3baae6c7c89c5b93 100644 |
--- a/Source/web/tests/KeyboardTest.cpp |
+++ b/Source/web/tests/KeyboardTest.cpp |
@@ -36,10 +36,15 @@ |
#include "core/editing/Editor.h" |
#include "core/events/EventTarget.h" |
#include "core/events/KeyboardEvent.h" |
+#include "core/frame/FrameView.h" |
#include "core/frame/Settings.h" |
+#include "core/page/Page.h" |
+#include "core/testing/URLTestHelpers.h" |
#include "platform/KeyboardCodes.h" |
#include "public/web/WebInputEvent.h" |
#include "web/WebInputEventConversion.h" |
+#include "web/WebViewImpl.h" |
+#include "web/tests/FrameTestHelpers.h" |
using namespace blink; |
@@ -55,7 +60,18 @@ public: |
const WebKeyboardEvent& webKeyboardEvent, |
PlatformEvent::Type keyType) |
{ |
- PlatformKeyboardEventBuilder evt(webKeyboardEvent); |
+ const std::string baseURL("http://www.test5.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
Doesn't this need cleaning up somewhere?
bokan
2015/01/20 17:05:58
webViewHelper will clean up on destruction. That s
Habib Virji
2015/01/22 16:01:30
Done.
|
+ int pageWidth = 640; |
+ int pageHeight = 480; |
+ webViewImpl->resize(WebSize(pageWidth, pageHeight)); |
+ webViewImpl->layout(); |
+ |
+ PlatformKeyboardEventBuilder evt(toLocalFrame(webViewImpl->page()->mainFrame())->view(), webKeyboardEvent); |
evt.setKeyType(keyType); |
RefPtrWillBeRawPtr<KeyboardEvent> keyboardEvent = KeyboardEvent::create(evt, 0); |
OwnPtr<Settings> settings = Settings::create(); |