Title: [110909] trunk
Revision
110909
Author
commit-qu...@webkit.org
Date
2012-03-15 16:44:01 -0700 (Thu, 15 Mar 2012)

Log Message

Implement LayoutTestController::setValueForUser on Windows https://bugs.webkit.org/show_bug.cgi?id=55834

Tools:

Implemented setValueForUser in both DumpRenderTree and WebKitTestRunner.

Patch by Lynn Neir <lynn.n...@skype.net> on 2012-03-15
Reviewed by Jessie Berlin.

* DumpRenderTree/win/LayoutTestControllerWin.cpp:
(LayoutTestController::setValueForUser):
* WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl:
* WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
(WTR::LayoutTestController::setValueForUser):
(WTR):
* WebKitTestRunner/InjectedBundle/LayoutTestController.h:
(LayoutTestController):

LayoutTests:

removed test, no longer needed as test passes and matches baseline expected results and also updated wk2 skipped file to no longer skip this test.

Patch by Lynn Neir <lynn.n...@skype.net> on 2012-03-15
Reviewed by Jessie Berlin.

* platform/win/fast/forms/onchange-setvalueforuser-expected.txt: Removed.
* platform/wk2/Skipped:

Modified Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (110908 => 110909)


--- trunk/LayoutTests/ChangeLog	2012-03-15 23:30:48 UTC (rev 110908)
+++ trunk/LayoutTests/ChangeLog	2012-03-15 23:44:01 UTC (rev 110909)
@@ -1,3 +1,14 @@
+2012-03-15  Lynn Neir  <lynn.n...@skype.net>
+
+        Implement LayoutTestController::setValueForUser on Windows https://bugs.webkit.org/show_bug.cgi?id=55834
+
+        removed test, no longer needed as test passes and matches baseline expected results and also updated wk2 skipped file to no longer skip this test.
+
+        Reviewed by Jessie Berlin.
+
+        * platform/win/fast/forms/onchange-setvalueforuser-expected.txt: Removed.
+        * platform/wk2/Skipped:
+
 2012-03-15  Jessie Berlin  <jber...@apple.com>
 
         Selection is not collapsed in some WK2 editing tests

Deleted: trunk/LayoutTests/platform/win/fast/forms/onchange-setvalueforuser-expected.txt (110908 => 110909)


--- trunk/LayoutTests/platform/win/fast/forms/onchange-setvalueforuser-expected.txt	2012-03-15 23:30:48 UTC (rev 110908)
+++ trunk/LayoutTests/platform/win/fast/forms/onchange-setvalueforuser-expected.txt	2012-03-15 23:44:01 UTC (rev 110909)
@@ -1,4 +0,0 @@
-This tests that onchange correctly fires after calling setValueForUser(). It can only be run using DumpRenderTree.
-
-FAIL onchange never fired
-

Modified: trunk/LayoutTests/platform/wk2/Skipped (110908 => 110909)


--- trunk/LayoutTests/platform/wk2/Skipped	2012-03-15 23:30:48 UTC (rev 110908)
+++ trunk/LayoutTests/platform/wk2/Skipped	2012-03-15 23:44:01 UTC (rev 110909)
@@ -1035,9 +1035,6 @@
 fast/dom/timer-increase-then-decrease-min-interval-repeating.html
 fast/dom/timer-increase-then-decrease-min-interval.html
 
-# WebKitTestRunner needs layoutTestController.setValueForUser
-fast/forms/onchange-setvalueforuser.html
-
 # WebKitTestRunner needs layoutTestController.originsWithLocalStorage
 storage/domstorage/localstorage/storagetracker/storage-tracker-1-prepare.html
 storage/domstorage/localstorage/storagetracker/storage-tracker-2-create.html

Modified: trunk/Tools/ChangeLog (110908 => 110909)


--- trunk/Tools/ChangeLog	2012-03-15 23:30:48 UTC (rev 110908)
+++ trunk/Tools/ChangeLog	2012-03-15 23:44:01 UTC (rev 110909)
@@ -1,3 +1,20 @@
+2012-03-15  Lynn Neir  <lynn.n...@skype.net>
+
+        Implement LayoutTestController::setValueForUser on Windows https://bugs.webkit.org/show_bug.cgi?id=55834
+
+        Implemented setValueForUser in both DumpRenderTree and WebKitTestRunner.
+
+        Reviewed by Jessie Berlin.
+
+        * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+        (LayoutTestController::setValueForUser):
+        * WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl:
+        * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
+        (WTR::LayoutTestController::setValueForUser):
+        (WTR):
+        * WebKitTestRunner/InjectedBundle/LayoutTestController.h:
+        (LayoutTestController):
+
 2012-03-15  Adam Barth  <aba...@webkit.org>
 
         Update the start-queue.sh script to match what we're using on the bots

Modified: trunk/Tools/DumpRenderTree/win/LayoutTestControllerWin.cpp (110908 => 110909)


--- trunk/Tools/DumpRenderTree/win/LayoutTestControllerWin.cpp	2012-03-15 23:30:48 UTC (rev 110908)
+++ trunk/Tools/DumpRenderTree/win/LayoutTestControllerWin.cpp	2012-03-15 23:44:01 UTC (rev 110909)
@@ -779,7 +779,25 @@
 
 void LayoutTestController::setValueForUser(JSContextRef context, JSValueRef element, JSStringRef value)
 {
-    // FIXME: implement
+    COMPtr<IWebView> webView;
+    if (FAILED(frame->webView(&webView)))
+        return;
+
+    COMPtr<IWebViewPrivate> webViewPrivate(Query, webView);
+    if (!webViewPrivate)
+        return;
+
+    COMPtr<IDOMElement> domElement;
+    if (FAILED(webViewPrivate->elementFromJS(context, element, &domElement)))
+        return;
+
+    COMPtr<IDOMHTMLInputElement> domInputElement;
+    if (FAILED(domElement->QueryInterface(IID_IDOMHTMLInputElement, reinterpret_cast<void**>(&domInputElement))))
+        return;
+
+    _bstr_t valueBSTR(JSStringCopyBSTR(value), false);
+
+    domInputElement->setValueForUser(valueBSTR);
 }
 
 void LayoutTestController::setViewModeMediaFeature(JSStringRef mode)

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl (110908 => 110909)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl	2012-03-15 23:30:48 UTC (rev 110908)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl	2012-03-15 23:44:01 UTC (rev 110909)
@@ -83,6 +83,8 @@
         DOMString pageSizeAndMarginsInPixels(in int pageIndex, in int width, in int height, in int marginTop, in int marginRight, in int marginBottom, in int marginLeft);
         boolean isPageBoxVisible(in int pageIndex);
 
+        [PassContext] void setValueForUser(in object element, in DOMString value);
+
         // Animation testing.
         int numberOfActiveAnimations();
         boolean pauseAnimationAtTimeOnElementWithId(in DOMString animationName, in double time, in DOMString elementId);

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp (110908 => 110909)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp	2012-03-15 23:30:48 UTC (rev 110908)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp	2012-03-15 23:44:01 UTC (rev 110909)
@@ -429,6 +429,15 @@
     return WKBundleIsPageBoxVisible(InjectedBundle::shared().bundle(), mainFrame, pageIndex);
 }
 
+void LayoutTestController::setValueForUser(JSContextRef context, JSValueRef element, JSStringRef value)
+{
+    if (!element || !JSValueIsObject(context, element))
+        return;
+
+    WKRetainPtr<WKBundleNodeHandleRef> nodeHandle(AdoptWK, WKBundleNodeHandleCreate(context, const_cast<JSObjectRef>(element)));
+    WKBundleNodeHandleSetHTMLInputElementValueForUser(nodeHandle.get(), toWK(value).get());
+}
+
 unsigned LayoutTestController::windowCount()
 {
     return InjectedBundle::shared().pageCount();

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.h (110908 => 110909)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.h	2012-03-15 23:30:48 UTC (rev 110908)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.h	2012-03-15 23:44:01 UTC (rev 110909)
@@ -138,6 +138,8 @@
     JSRetainPtr<JSStringRef> pageSizeAndMarginsInPixels(int pageIndex, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft);
     bool isPageBoxVisible(int pageIndex);
 
+    void setValueForUser(JSContextRef, JSValueRef element, JSStringRef value);
+
     enum WhatToDump { RenderTree, MainFrameText, AllFramesText };
     WhatToDump whatToDump() const { return m_whatToDump; }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to