Title: [97797] trunk
Revision
97797
Author
[email protected]
Date
2011-10-18 15:45:35 -0700 (Tue, 18 Oct 2011)

Log Message

[EFL] DRT: Clear list of visited pages before each test.
https://bugs.webkit.org/show_bug.cgi?id=70355

Patch by Raphael Kubo da Costa <[email protected]> on 2011-10-18
Reviewed by Antonio Gomes.

Source/WebKit/efl:

Add ewk_history_clear as a way to clear the list of visited pages in a
Ewk_History, in a similar fashion to Qt's QWebHistory::clear().

* ewk/ewk_history.cpp:
(ewk_history_clear):
* ewk/ewk_history.h:

Tools:

r97596 uncovered a bug in the implementation: the list of visited
links was not cleared between tests, which caused tests such as
fast/repaint/outline-repaint-glitch.html to be flaky (the link color
changed depending on whether fast/repaint/border-repaint-glitch.html
was visited before or not).

Call ewk_history_clear to make sure the visited links list does not
persist between tests.

* DumpRenderTree/efl/DumpRenderTreeChrome.cpp:
(DumpRenderTreeChrome::resetDefaultsToConsistentValues):

Modified Paths

Diff

Modified: trunk/Source/WebKit/efl/ChangeLog (97796 => 97797)


--- trunk/Source/WebKit/efl/ChangeLog	2011-10-18 22:38:29 UTC (rev 97796)
+++ trunk/Source/WebKit/efl/ChangeLog	2011-10-18 22:45:35 UTC (rev 97797)
@@ -1,3 +1,17 @@
+2011-10-18  Raphael Kubo da Costa  <[email protected]>
+
+        [EFL] DRT: Clear list of visited pages before each test.
+        https://bugs.webkit.org/show_bug.cgi?id=70355
+
+        Reviewed by Antonio Gomes.
+
+        Add ewk_history_clear as a way to clear the list of visited pages in a
+        Ewk_History, in a similar fashion to Qt's QWebHistory::clear().
+
+        * ewk/ewk_history.cpp:
+        (ewk_history_clear):
+        * ewk/ewk_history.h:
+
 2011-10-18  Grzegorz Czajkowski  <[email protected]>
 
         [EFL] Remove const modifier from ctx_menu functions.

Modified: trunk/Source/WebKit/efl/ewk/ewk_history.cpp (97796 => 97797)


--- trunk/Source/WebKit/efl/ewk/ewk_history.cpp	2011-10-18 22:38:29 UTC (rev 97796)
+++ trunk/Source/WebKit/efl/ewk/ewk_history.cpp	2011-10-18 22:45:35 UTC (rev 97797)
@@ -27,6 +27,8 @@
 #include "IconDatabaseBase.h"
 #include "Image.h"
 #include "IntSize.h"
+#include "Page.h"
+#include "PageGroup.h"
 #include "ewk_private.h"
 
 #include <Eina.h>
@@ -88,6 +90,21 @@
     return ret;
 }
 
+Eina_Bool ewk_history_clear(Ewk_History* history)
+{
+    EWK_HISTORY_CORE_GET_OR_RETURN(history, core, EINA_FALSE);
+
+    WebCore::Page* page = core->page();
+    if (page && page->groupPtr())
+        page->groupPtr()->removeVisitedLinks();
+
+    const int limit = ewk_history_limit_get(history);
+    ewk_history_limit_set(history, 0);
+    ewk_history_limit_set(history, limit);
+
+    return EINA_TRUE;
+}
+
 Eina_Bool ewk_history_forward(Ewk_History* history)
 {
     EWK_HISTORY_CORE_GET_OR_RETURN(history, core, EINA_FALSE);

Modified: trunk/Source/WebKit/efl/ewk/ewk_history.h (97796 => 97797)


--- trunk/Source/WebKit/efl/ewk/ewk_history.h	2011-10-18 22:38:29 UTC (rev 97796)
+++ trunk/Source/WebKit/efl/ewk/ewk_history.h	2011-10-18 22:45:35 UTC (rev 97797)
@@ -50,6 +50,15 @@
 
 
 /**
+ * Clear the current history, if there is any.
+ *
+ * @param history which history instance to modify.
+ *
+ * @return @c EINA_TRUE on success, @c EINA_FALSE on failure.
+ */
+EAPI Eina_Bool         ewk_history_clear(Ewk_History *history);
+
+/**
  * Go forward in history one item, if possible.
  *
  * @param history which history instance to modify.

Modified: trunk/Tools/ChangeLog (97796 => 97797)


--- trunk/Tools/ChangeLog	2011-10-18 22:38:29 UTC (rev 97796)
+++ trunk/Tools/ChangeLog	2011-10-18 22:45:35 UTC (rev 97797)
@@ -1,3 +1,22 @@
+2011-10-18  Raphael Kubo da Costa  <[email protected]>
+
+        [EFL] DRT: Clear list of visited pages before each test.
+        https://bugs.webkit.org/show_bug.cgi?id=70355
+
+        Reviewed by Antonio Gomes.
+
+        r97596 uncovered a bug in the implementation: the list of visited
+        links was not cleared between tests, which caused tests such as
+        fast/repaint/outline-repaint-glitch.html to be flaky (the link color
+        changed depending on whether fast/repaint/border-repaint-glitch.html
+        was visited before or not).
+
+        Call ewk_history_clear to make sure the visited links list does not
+        persist between tests.
+
+        * DumpRenderTree/efl/DumpRenderTreeChrome.cpp:
+        (DumpRenderTreeChrome::resetDefaultsToConsistentValues):
+
 2011-10-18  Dimitri Glazkov  <[email protected]>
 
         Split TestExpectationsEditor into its own file.

Modified: trunk/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp (97796 => 97797)


--- trunk/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp	2011-10-18 22:38:29 UTC (rev 97796)
+++ trunk/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp	2011-10-18 22:45:35 UTC (rev 97797)
@@ -178,10 +178,7 @@
     ewk_view_zoom_set(mainView(), 1.0, 0, 0);
     ewk_view_page_scale(mainView(), 1.0, 0, 0);
 
-    Ewk_History* history = ewk_view_history_get(mainView());
-    int limit = ewk_history_limit_get(history);
-    ewk_history_limit_set(history, 0);
-    ewk_history_limit_set(history, limit);
+    ewk_history_clear(ewk_view_history_get(mainView()));
 
     ewk_cookies_clear();
     ewk_cookies_policy_set(EWK_COOKIE_JAR_ACCEPT_NO_THIRD_PARTY);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to