Title: [168122] trunk
Revision
168122
Author
ander...@apple.com
Date
2014-05-01 14:53:47 -0700 (Thu, 01 May 2014)

Log Message

window.testRunner.keepWebHistory() should update the UI process state
https://bugs.webkit.org/show_bug.cgi?id=132440

Reviewed by Dan Bernstein.

Source/WebKit2:
* UIProcess/API/C/WKPage.cpp:
(WKPageGetAddsVisitedLinks):
(WKPageSetAddsVisitedLinks):
* UIProcess/API/C/WKPagePrivate.h:

Tools:
* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::postSetAddsVisitedLinks):
* WebKitTestRunner/InjectedBundle/InjectedBundle.h:
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::keepWebHistory):
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::invoke):
(WTR::TestInvocation::didReceiveMessageFromInjectedBundle):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (168121 => 168122)


--- trunk/Source/WebKit2/ChangeLog	2014-05-01 21:00:19 UTC (rev 168121)
+++ trunk/Source/WebKit2/ChangeLog	2014-05-01 21:53:47 UTC (rev 168122)
@@ -1,3 +1,15 @@
+2014-05-01  Anders Carlsson  <ander...@apple.com>
+
+        window.testRunner.keepWebHistory() should update the UI process state
+        https://bugs.webkit.org/show_bug.cgi?id=132440
+
+        Reviewed by Dan Bernstein.
+
+        * UIProcess/API/C/WKPage.cpp:
+        (WKPageGetAddsVisitedLinks):
+        (WKPageSetAddsVisitedLinks):
+        * UIProcess/API/C/WKPagePrivate.h:
+
 2014-05-01  Filip Pizlo  <fpi...@apple.com>
 
         Roll out r60161.

Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp (168121 => 168122)


--- trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp	2014-05-01 21:00:19 UTC (rev 168121)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp	2014-05-01 21:53:47 UTC (rev 168122)
@@ -1787,6 +1787,16 @@
     toImpl(page)->setScrollPinningBehavior(corePinning);
 }
 
+bool WKPageGetAddsVisitedLinks(WKPageRef page)
+{
+    return toImpl(page)->addsVisitedLinks();
+}
+
+void WKPageSetAddsVisitedLinks(WKPageRef page, bool addsVisitedLinks)
+{
+    toImpl(page)->setAddsVisitedLinks(addsVisitedLinks);
+}
+
 void WKPageSetInvalidMessageFunction(WKPageInvalidMessageFunction)
 {
     // FIXME: Remove this function when doing so won't break WebKit nightlies.

Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPagePrivate.h (168121 => 168122)


--- trunk/Source/WebKit2/UIProcess/API/C/WKPagePrivate.h	2014-05-01 21:00:19 UTC (rev 168121)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPagePrivate.h	2014-05-01 21:53:47 UTC (rev 168122)
@@ -111,6 +111,9 @@
 WK_EXPORT WKScrollPinningBehavior WKPageGetScrollPinningBehavior(WKPageRef page);
 WK_EXPORT void WKPageSetScrollPinningBehavior(WKPageRef page, WKScrollPinningBehavior pinning);
 
+WK_EXPORT bool WKPageGetAddsVisitedLinks(WKPageRef page);
+WK_EXPORT void WKPageSetAddsVisitedLinks(WKPageRef page, bool visitedLinks);
+
 #ifdef __cplusplus
 }
 #endif

Modified: trunk/Tools/ChangeLog (168121 => 168122)


--- trunk/Tools/ChangeLog	2014-05-01 21:00:19 UTC (rev 168121)
+++ trunk/Tools/ChangeLog	2014-05-01 21:53:47 UTC (rev 168122)
@@ -1,3 +1,19 @@
+2014-05-01  Anders Carlsson  <ander...@apple.com>
+
+        window.testRunner.keepWebHistory() should update the UI process state
+        https://bugs.webkit.org/show_bug.cgi?id=132440
+
+        Reviewed by Dan Bernstein.
+
+        * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
+        (WTR::InjectedBundle::postSetAddsVisitedLinks):
+        * WebKitTestRunner/InjectedBundle/InjectedBundle.h:
+        * WebKitTestRunner/InjectedBundle/TestRunner.cpp:
+        (WTR::TestRunner::keepWebHistory):
+        * WebKitTestRunner/TestInvocation.cpp:
+        (WTR::TestInvocation::invoke):
+        (WTR::TestInvocation::didReceiveMessageFromInjectedBundle):
+
 2014-05-01  David Kilzer  <ddkil...@apple.com>
 
         Really remove ENABLE_PLUGIN_PROXY_FOR_VIDEO

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp (168121 => 168122)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp	2014-05-01 21:00:19 UTC (rev 168121)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp	2014-05-01 21:53:47 UTC (rev 168122)
@@ -238,7 +238,6 @@
     m_textInputController = TextInputController::create();
     m_accessibilityController = AccessibilityController::create();
 
-    WKBundleSetShouldTrackVisitedLinks(m_bundle, false);
     WKBundleRemoveAllVisitedLinks(m_bundle);
     WKBundleSetAllowUniversalAccessFromFileURLs(m_bundle, m_pageGroup, true);
     WKBundleSetJavaScriptCanAccessClipboard(m_bundle, m_pageGroup, true);
@@ -381,6 +380,13 @@
     WKBundlePostMessage(m_bundle, messageName.get(), messageBody.get());
 }
 
+void InjectedBundle::postSetAddsVisitedLinks(bool addsVisitedLinks)
+{
+    WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetAddsVisitedLinks"));
+    WKRetainPtr<WKBooleanRef> messageBody(AdoptWK, WKBooleanCreate(addsVisitedLinks));
+    WKBundlePostMessage(m_bundle, messageName.get(), messageBody.get());
+}
+
 void InjectedBundle::setGeolocationPermission(bool enabled)
 {
     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetGeolocationPermission"));

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h (168121 => 168122)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h	2014-05-01 21:00:19 UTC (rev 168121)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h	2014-05-01 21:53:47 UTC (rev 168122)
@@ -86,6 +86,7 @@
     void postSetBackingScaleFactor(double);
     void postSetWindowIsKey(bool);
     void postSimulateWebNotificationClick(uint64_t notificationID);
+    void postSetAddsVisitedLinks(bool);
 
     // Geolocation.
     void setGeolocationPermission(bool);

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp (168121 => 168122)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp	2014-05-01 21:00:19 UTC (rev 168121)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp	2014-05-01 21:53:47 UTC (rev 168122)
@@ -190,7 +190,7 @@
 
 void TestRunner::keepWebHistory()
 {
-    WKBundleSetShouldTrackVisitedLinks(InjectedBundle::shared().bundle(), true);
+    InjectedBundle::shared().postSetAddsVisitedLinks(true);
 }
 
 void TestRunner::execCommand(JSStringRef name, JSStringRef argument)

Modified: trunk/Tools/WebKitTestRunner/TestInvocation.cpp (168121 => 168122)


--- trunk/Tools/WebKitTestRunner/TestInvocation.cpp	2014-05-01 21:00:19 UTC (rev 168121)
+++ trunk/Tools/WebKitTestRunner/TestInvocation.cpp	2014-05-01 21:53:47 UTC (rev 168122)
@@ -36,6 +36,7 @@
 #include <WebKit2/WKData.h>
 #include <WebKit2/WKDictionary.h>
 #include <WebKit2/WKInspector.h>
+#include <WebKit2/WKPagePrivate.h>
 #include <WebKit2/WKRetainPtr.h>
 #include <wtf/PassOwnPtr.h>
 #include <wtf/StdLibExtras.h>
@@ -208,6 +209,8 @@
     updateLayoutType(m_pathOrURL.c_str());
     updateThreadedScrollingForCurrentTest(m_pathOrURL.c_str());
 
+    WKPageSetAddsVisitedLinks(TestController::shared().mainWebView()->page(), false);
+
     m_textOutput.clear();
 
     TestController::shared().setShouldLogHistoryClientCallbacks(shouldLogHistoryClientCallbacks(m_pathOrURL.c_str()));
@@ -470,6 +473,13 @@
         return;
     }
 
+    if (WKStringIsEqualToUTF8CString(messageName, "SetAddsVisitedLinks")) {
+        ASSERT(WKGetTypeID(messageBody) == WKBooleanGetTypeID());
+        WKBooleanRef enabledWK = static_cast<WKBooleanRef>(messageBody);
+        WKPageSetAddsVisitedLinks(TestController::shared().mainWebView()->page(), WKBooleanGetValue(enabledWK));
+        return;
+    }
+
     if (WKStringIsEqualToUTF8CString(messageName, "SetGeolocationPermission")) {
         ASSERT(WKGetTypeID(messageBody) == WKBooleanGetTypeID());
         WKBooleanRef enabledWK = static_cast<WKBooleanRef>(messageBody);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to