Stop using testRunner.overridePreference() to turn on Page Cache
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Sep 2019 21:37:38 +0000 (21:37 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Sep 2019 21:37:38 +0000 (21:37 +0000)
https://bugs.webkit.org/show_bug.cgi?id=202274

Reviewed by Alex Christensen.

Source/WebKit:

* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):

Tools:

* DumpRenderTree/TestRunner.cpp:
(overridePreferenceCallback):
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::overridePreference):

LayoutTests:

Stop using testRunner.overridePreference() to turn on Page Cache, as this does not work
for WebKit2 when navigating cross-origin due to process swapping. Instead, update tests
to rely on `<!-- webkit-test-runner [ enablePageCache=true ] -->`.

* animations/resume-after-page-cache.html:
* compositing/accelerated-layers-after-back.html:
* compositing/iframes/page-cache-layer-tree.html:
* compositing/page-cache-back-crash.html:
* compositing/show-composited-iframe-on-back-button.html:
* editing/mac/input/unconfirmed-text-navigation-with-page-cache.html:
* fast/css/fontloader-page-cache.html:
* fast/dom/DeviceMotion/no-page-cache.html:
* fast/dom/DeviceOrientation/event-after-navigation.html:
* fast/dom/DeviceOrientation/no-page-cache.html:
* fast/dom/Window/timer-resume-on-navigation-back.html:
* fast/events/onunload-back-to-page-cache.html:
* fast/events/pagehide-timeout-expected.txt:
* fast/events/pagehide-timeout.html:
* fast/events/pagehide-xhr-open-expected.txt:
* fast/events/pagehide-xhr-open.html:
* fast/events/pageshow-pagehide-on-back-cached-with-frames.html:
* fast/events/pageshow-pagehide-on-back-cached.html:
* fast/events/suspend-timers-expected.txt:
* fast/events/suspend-timers.html:
* fast/forms/autocomplete-off-with-default-value-does-not-clear.html:
* fast/frames/frame-crash-with-page-cache.html:
* fast/frames/frame-unload-navigate-and-setTimeout-assert-fail.html:
* fast/frames/page-hide-document-open.html:
* fast/frames/restoring-page-cache-should-not-run-scripts-via-style-update.html:
* fast/frames/restoring-page-cache-should-not-run-scripts.html:
* fast/harness/page-cache-crash-on-data-urls.html:
* fast/harness/use-page-cache-expected.txt:
* fast/harness/use-page-cache.html:
* fast/history/back-from-page-with-focused-iframe.html:
* fast/history/go-back-to-iframe-with-plugin.html:
* fast/history/go-back-to-object-subframe.html:
* fast/history/history-back-while-pdf-in-pagecache.html:
* fast/history/page-cache-MessagePort-pending-message.html:
* fast/history/page-cache-after-window-open.html:
* fast/history/page-cache-back-navigation-crash.html:
* fast/history/page-cache-clearing-expected.txt:
* fast/history/page-cache-clearing.html:
* fast/history/page-cache-closed-audiocontext.html:
* fast/history/page-cache-createObjectURL-using-open-panel.html:
* fast/history/page-cache-createObjectURL.html:
* fast/history/page-cache-destroy-document.html:
* fast/history/page-cache-element-state-focused.html:
* fast/history/page-cache-execute-script-during-restore.html:
* fast/history/page-cache-geolocation-active-oneshot.html:
* fast/history/page-cache-geolocation-active-watcher.html:
* fast/history/page-cache-geolocation.html:
* fast/history/page-cache-indexed-closed-db.html:
* fast/history/page-cache-indexed-opened-db.html:
* fast/history/page-cache-media-source-closed-2.html:
* fast/history/page-cache-media-source-closed.html:
* fast/history/page-cache-media-source-opened.html:
* fast/history/page-cache-navigate-during-restore.html:
* fast/history/page-cache-notification-non-suspendable.html:
* fast/history/page-cache-notification-suspendable.html:
* fast/history/page-cache-removed-source-buffer.html:
* fast/history/page-cache-running-audiocontext.html:
* fast/history/page-cache-suspended-audiocontext.html:
* fast/history/page-cache-webdatabase-no-transaction-db-expected.txt:
* fast/history/page-cache-webdatabase-no-transaction-db.html:
* fast/history/page-cache-webdatabase-pending-transaction.html:
* fast/history/page-cache-with-opener.html:
* fast/history/pagehide-remove-iframe-crash.html:
* fast/history/resources/page-cache-window-with-iframe.html:
* fast/history/resources/page-cache-window-with-opener.html:
* fast/history/timed-refresh-in-cached-frame.html:
* fast/images/animated-gif-restored-from-bfcache.html:
* fast/loader/frames-with-unload-handlers-in-page-cache.html:
* fast/loader/image-in-page-cache.html:
* fast/loader/input-element-page-cache-crash.html:
* fast/loader/navigate-with-new-target-after-back-forward-navigation.html:
* fast/loader/navigate-with-post-to-new-target-after-back-forward-navigation.html:
* fast/loader/scroll-position-restored-on-back.html:
* fast/loader/stateobjects/no-popstate-when-back-to-stateless-entry-with-page-cache.html:
* fast/loader/stateobjects/popstate-fires-with-page-cache.html:
* fast/loader/unschedule-relayout-after-unload.html:
* fast/loader/window-properties-restored-from-page-cache.html:
* fast/overflow/horizontal-scroll-after-back.html:
* fast/scrolling/iframe-scrollable-after-back.html:
* fast/scrolling/ios/scroll-events-back-forward-after-pageshow.html:
* fast/scrolling/ios/scroll-events-back-forward.html:
* fast/scrolling/ios/touch-scroll-back-forward.html:
* fast/scrolling/overflow-scrollable-after-back.html:
* fast/scrolling/page-cache-back-overflow-scroll-restore.html:
* fast/text-autosizing/ios/text-autosizing-after-back.html:
* fast/viewport/ios/viewport-shrink-to-fit-on-new-navigation.html:
* fast/viewport/viewport-128.html:
* http/tests/cache/display-image-unset-allows-cached-image-load.html:
* http/tests/loading/main-resource-delegates-on-back-navigation-expected.txt:
* http/tests/loading/main-resource-delegates-on-back-navigation.html:
* http/tests/loading/unfinished-load-back-to-cached-page-callbacks.html:
* http/tests/loading/unfinished-main-resource-back-to-cached-page-callbacks.html:
* http/tests/media/reload-after-dialog.html:
* http/tests/navigation/go-back-to-error-page.html:
* http/tests/navigation/https-in-page-cache.html:
* http/tests/navigation/https-no-store-subframe-in-page-cache.html:
* http/tests/navigation/image-load-in-pagehide-handler.html:
* http/tests/navigation/page-cache-fragment-referrer.html:
* http/tests/navigation/page-cache-iframe-no-current-historyItem.html:
* http/tests/navigation/page-cache-iframe-provisional-load-async-delegates.html:
* http/tests/navigation/page-cache-iframe-provisional-load.html:
* http/tests/navigation/page-cache-pending-image-load-cache-partition.html:
* http/tests/navigation/page-cache-pending-image-load.html:
* http/tests/navigation/page-cache-pending-ping-load-cross-origin.html:
* http/tests/navigation/page-cache-pending-ping-load-same-origin.html:
* http/tests/navigation/page-cache-xhr-in-pagehide-expected.txt:
* http/tests/navigation/page-cache-xhr-in-pagehide.html:
* http/tests/navigation/page-cache-xhr.html:
* http/tests/navigation/resources/https-in-page-cache-1.php:
* http/tests/navigation/resources/https-in-page-cache-2.php:
* http/tests/navigation/resources/https-in-page-cache-3.html:
* http/tests/navigation/resources/https-no-store-subframe-in-page-cache.html:
* http/tests/navigation/subframe-pagehide-handler-starts-load.html:
* http/tests/navigation/subframe-pagehide-handler-starts-load2.html:
* http/tests/security/cross-origin-window-open-insert-script.html:
* http/tests/security/cross-origin-window-open-javascript-url.html:
* http/tests/security/navigate-when-restoring-cached-page.html:
* http/tests/security/xss-DENIED-click-and-form-submission-from-inactive-domwindow.html:
* http/tests/security/xss-DENIED-script-inject-into-inactive-window.html:
* http/tests/security/xss-DENIED-script-inject-into-inactive-window2-pson.html:
* http/tests/security/xss-DENIED-script-inject-into-inactive-window2.html:
* http/tests/security/xss-DENIED-script-inject-into-inactive-window3.html:
* http/tests/websocket/tests/hybi/closed-when-entering-page-cache.html:
* http/tests/websocket/tests/hybi/stop-on-resume-in-error-handler.html:
* http/tests/workers/service/client-added-to-clients-when-restored-from-page-cache.html:
* http/tests/workers/service/client-removed-from-clients-while-in-page-cache.html:
* http/wpt/beacon/support/sendBeacon-onpagehide-window.html:
* legacy-animation-engine/animations/resume-after-page-cache.html:
* loader/go-back-cached-main-resource.html:
* loader/go-back-to-different-window-size.html:
* media/crash-closing-page-with-media-as-plugin-fallback.html:
* media/restore-from-page-cache.html:
* platform/ios/ios/fixed/fixed-back-forward.html:
* plugins/crash-restoring-plugin-page-from-page-cache.html:
* plugins/frameset-with-plugin-frame.html:
* plugins/netscape-plugin-page-cache-works.html:
* swipe/basic-cached-back-swipe.html:
* swipe/main-frame-pinning-requirement.html:
* swipe/pushState-cached-back-swipe.html:
* swipe/pushState-programmatic-back-while-swiping-crash.html:
* swipe/pushstate-with-manual-scrollrestoration.html:
* tiled-drawing/scrolling/null-parent-back-crash.html:
* tiled-drawing/tiled-drawing-scroll-position-page-cache-restoration.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250398 268f45cc-cd09-0410-ab3c-d52691b4dbfc

149 files changed:
LayoutTests/ChangeLog
LayoutTests/animations/resume-after-page-cache.html
LayoutTests/compositing/accelerated-layers-after-back.html
LayoutTests/compositing/iframes/page-cache-layer-tree.html
LayoutTests/compositing/page-cache-back-crash.html
LayoutTests/compositing/show-composited-iframe-on-back-button.html
LayoutTests/editing/mac/input/unconfirmed-text-navigation-with-page-cache.html
LayoutTests/fast/css/fontloader-page-cache.html
LayoutTests/fast/dom/DeviceMotion/no-page-cache.html
LayoutTests/fast/dom/DeviceOrientation/event-after-navigation.html
LayoutTests/fast/dom/DeviceOrientation/no-page-cache.html
LayoutTests/fast/dom/Window/timer-resume-on-navigation-back.html
LayoutTests/fast/events/onunload-back-to-page-cache.html
LayoutTests/fast/events/pagehide-timeout-expected.txt
LayoutTests/fast/events/pagehide-timeout.html
LayoutTests/fast/events/pagehide-xhr-open-expected.txt
LayoutTests/fast/events/pagehide-xhr-open.html
LayoutTests/fast/events/pageshow-pagehide-on-back-cached-with-frames.html
LayoutTests/fast/events/pageshow-pagehide-on-back-cached.html
LayoutTests/fast/events/suspend-timers-expected.txt
LayoutTests/fast/events/suspend-timers.html
LayoutTests/fast/forms/autocomplete-off-with-default-value-does-not-clear.html
LayoutTests/fast/frames/frame-crash-with-page-cache.html
LayoutTests/fast/frames/frame-unload-navigate-and-setTimeout-assert-fail.html
LayoutTests/fast/frames/page-hide-document-open.html
LayoutTests/fast/frames/restoring-page-cache-should-not-run-scripts-via-style-update.html
LayoutTests/fast/frames/restoring-page-cache-should-not-run-scripts.html
LayoutTests/fast/harness/page-cache-crash-on-data-urls.html
LayoutTests/fast/harness/use-page-cache-expected.txt
LayoutTests/fast/harness/use-page-cache.html
LayoutTests/fast/history/back-from-page-with-focused-iframe.html
LayoutTests/fast/history/go-back-to-iframe-with-plugin.html
LayoutTests/fast/history/go-back-to-object-subframe.html
LayoutTests/fast/history/history-back-while-pdf-in-pagecache.html
LayoutTests/fast/history/page-cache-MessagePort-pending-message.html
LayoutTests/fast/history/page-cache-after-window-open.html
LayoutTests/fast/history/page-cache-back-navigation-crash.html
LayoutTests/fast/history/page-cache-clearing-expected.txt
LayoutTests/fast/history/page-cache-clearing.html
LayoutTests/fast/history/page-cache-closed-audiocontext.html
LayoutTests/fast/history/page-cache-createObjectURL-using-open-panel.html
LayoutTests/fast/history/page-cache-createObjectURL.html
LayoutTests/fast/history/page-cache-destroy-document.html
LayoutTests/fast/history/page-cache-element-state-focused.html
LayoutTests/fast/history/page-cache-execute-script-during-restore.html
LayoutTests/fast/history/page-cache-geolocation-active-oneshot.html
LayoutTests/fast/history/page-cache-geolocation-active-watcher.html
LayoutTests/fast/history/page-cache-geolocation.html
LayoutTests/fast/history/page-cache-indexed-closed-db.html
LayoutTests/fast/history/page-cache-indexed-opened-db.html
LayoutTests/fast/history/page-cache-media-source-closed-2.html
LayoutTests/fast/history/page-cache-media-source-closed.html
LayoutTests/fast/history/page-cache-media-source-opened.html
LayoutTests/fast/history/page-cache-navigate-during-restore.html
LayoutTests/fast/history/page-cache-notification-non-suspendable.html
LayoutTests/fast/history/page-cache-notification-suspendable.html
LayoutTests/fast/history/page-cache-removed-source-buffer.html
LayoutTests/fast/history/page-cache-running-audiocontext.html
LayoutTests/fast/history/page-cache-suspended-audiocontext.html
LayoutTests/fast/history/page-cache-webdatabase-no-transaction-db-expected.txt
LayoutTests/fast/history/page-cache-webdatabase-no-transaction-db.html
LayoutTests/fast/history/page-cache-webdatabase-pending-transaction.html
LayoutTests/fast/history/page-cache-with-opener.html
LayoutTests/fast/history/pagehide-remove-iframe-crash.html
LayoutTests/fast/history/resources/page-cache-window-with-iframe.html
LayoutTests/fast/history/resources/page-cache-window-with-opener.html
LayoutTests/fast/history/timed-refresh-in-cached-frame.html
LayoutTests/fast/images/animated-gif-restored-from-bfcache.html
LayoutTests/fast/loader/frames-with-unload-handlers-in-page-cache.html
LayoutTests/fast/loader/image-in-page-cache.html
LayoutTests/fast/loader/input-element-page-cache-crash.html
LayoutTests/fast/loader/navigate-with-new-target-after-back-forward-navigation.html
LayoutTests/fast/loader/navigate-with-post-to-new-target-after-back-forward-navigation.html
LayoutTests/fast/loader/scroll-position-restored-on-back.html
LayoutTests/fast/loader/stateobjects/no-popstate-when-back-to-stateless-entry-with-page-cache.html
LayoutTests/fast/loader/stateobjects/popstate-fires-with-page-cache.html
LayoutTests/fast/loader/unschedule-relayout-after-unload.html
LayoutTests/fast/loader/window-properties-restored-from-page-cache.html
LayoutTests/fast/overflow/horizontal-scroll-after-back.html
LayoutTests/fast/scrolling/iframe-scrollable-after-back.html
LayoutTests/fast/scrolling/ios/scroll-events-back-forward-after-pageshow.html
LayoutTests/fast/scrolling/ios/scroll-events-back-forward.html
LayoutTests/fast/scrolling/ios/touch-scroll-back-forward.html
LayoutTests/fast/scrolling/overflow-scrollable-after-back.html
LayoutTests/fast/scrolling/page-cache-back-overflow-scroll-restore.html
LayoutTests/fast/text-autosizing/ios/text-autosizing-after-back.html
LayoutTests/fast/viewport/ios/viewport-shrink-to-fit-on-new-navigation.html
LayoutTests/fast/viewport/viewport-128.html
LayoutTests/http/tests/cache/display-image-unset-allows-cached-image-load.html
LayoutTests/http/tests/loading/main-resource-delegates-on-back-navigation-expected.txt
LayoutTests/http/tests/loading/main-resource-delegates-on-back-navigation.html
LayoutTests/http/tests/loading/unfinished-load-back-to-cached-page-callbacks.html
LayoutTests/http/tests/loading/unfinished-main-resource-back-to-cached-page-callbacks.html
LayoutTests/http/tests/media/reload-after-dialog.html
LayoutTests/http/tests/navigation/go-back-to-error-page.html
LayoutTests/http/tests/navigation/https-in-page-cache.html
LayoutTests/http/tests/navigation/https-no-store-subframe-in-page-cache.html
LayoutTests/http/tests/navigation/image-load-in-pagehide-handler.html
LayoutTests/http/tests/navigation/page-cache-fragment-referrer.html
LayoutTests/http/tests/navigation/page-cache-iframe-no-current-historyItem.html
LayoutTests/http/tests/navigation/page-cache-iframe-provisional-load-async-delegates.html
LayoutTests/http/tests/navigation/page-cache-iframe-provisional-load.html
LayoutTests/http/tests/navigation/page-cache-pending-image-load-cache-partition.html
LayoutTests/http/tests/navigation/page-cache-pending-image-load.html
LayoutTests/http/tests/navigation/page-cache-pending-ping-load-cross-origin.html
LayoutTests/http/tests/navigation/page-cache-pending-ping-load-same-origin.html
LayoutTests/http/tests/navigation/page-cache-xhr-in-pagehide-expected.txt
LayoutTests/http/tests/navigation/page-cache-xhr-in-pagehide.html
LayoutTests/http/tests/navigation/page-cache-xhr.html
LayoutTests/http/tests/navigation/resources/https-in-page-cache-1.php
LayoutTests/http/tests/navigation/resources/https-in-page-cache-2.php
LayoutTests/http/tests/navigation/resources/https-in-page-cache-3.html
LayoutTests/http/tests/navigation/resources/https-no-store-subframe-in-page-cache.html
LayoutTests/http/tests/navigation/subframe-pagehide-handler-starts-load.html
LayoutTests/http/tests/navigation/subframe-pagehide-handler-starts-load2.html
LayoutTests/http/tests/security/cross-origin-window-open-insert-script.html
LayoutTests/http/tests/security/cross-origin-window-open-javascript-url.html
LayoutTests/http/tests/security/navigate-when-restoring-cached-page.html
LayoutTests/http/tests/security/xss-DENIED-click-and-form-submission-from-inactive-domwindow.html
LayoutTests/http/tests/security/xss-DENIED-script-inject-into-inactive-window.html
LayoutTests/http/tests/security/xss-DENIED-script-inject-into-inactive-window2-pson.html
LayoutTests/http/tests/security/xss-DENIED-script-inject-into-inactive-window2.html
LayoutTests/http/tests/security/xss-DENIED-script-inject-into-inactive-window3.html
LayoutTests/http/tests/websocket/tests/hybi/closed-when-entering-page-cache.html
LayoutTests/http/tests/websocket/tests/hybi/stop-on-resume-in-error-handler.html
LayoutTests/http/tests/workers/service/client-added-to-clients-when-restored-from-page-cache.html
LayoutTests/http/tests/workers/service/client-removed-from-clients-while-in-page-cache.html
LayoutTests/http/wpt/beacon/support/sendBeacon-onpagehide-window.html
LayoutTests/legacy-animation-engine/animations/resume-after-page-cache.html
LayoutTests/loader/go-back-cached-main-resource.html
LayoutTests/loader/go-back-to-different-window-size.html
LayoutTests/media/crash-closing-page-with-media-as-plugin-fallback.html
LayoutTests/media/restore-from-page-cache.html
LayoutTests/platform/ios/ios/fixed/fixed-back-forward.html
LayoutTests/plugins/crash-restoring-plugin-page-from-page-cache.html
LayoutTests/plugins/frameset-with-plugin-frame.html
LayoutTests/plugins/netscape-plugin-page-cache-works.html
LayoutTests/swipe/basic-cached-back-swipe.html
LayoutTests/swipe/main-frame-pinning-requirement.html
LayoutTests/swipe/pushState-cached-back-swipe.html
LayoutTests/swipe/pushState-programmatic-back-while-swiping-crash.html
LayoutTests/swipe/pushstate-with-manual-scrollrestoration.html
LayoutTests/tiled-drawing/scrolling/null-parent-back-crash.html
LayoutTests/tiled-drawing/tiled-drawing-scroll-position-page-cache-restoration.html
Source/WebKit/ChangeLog
Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.cpp
Tools/ChangeLog
Tools/DumpRenderTree/TestRunner.cpp
Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp

index 9343a21..da9f613 100644 (file)
@@ -1,3 +1,158 @@
+2019-09-26  Chris Dumez  <cdumez@apple.com>
+
+        Stop using testRunner.overridePreference() to turn on Page Cache
+        https://bugs.webkit.org/show_bug.cgi?id=202274
+
+        Reviewed by Alex Christensen.
+
+        Stop using testRunner.overridePreference() to turn on Page Cache, as this does not work
+        for WebKit2 when navigating cross-origin due to process swapping. Instead, update tests
+        to rely on `<!-- webkit-test-runner [ enablePageCache=true ] -->`.
+
+        * animations/resume-after-page-cache.html:
+        * compositing/accelerated-layers-after-back.html:
+        * compositing/iframes/page-cache-layer-tree.html:
+        * compositing/page-cache-back-crash.html:
+        * compositing/show-composited-iframe-on-back-button.html:
+        * editing/mac/input/unconfirmed-text-navigation-with-page-cache.html:
+        * fast/css/fontloader-page-cache.html:
+        * fast/dom/DeviceMotion/no-page-cache.html:
+        * fast/dom/DeviceOrientation/event-after-navigation.html:
+        * fast/dom/DeviceOrientation/no-page-cache.html:
+        * fast/dom/Window/timer-resume-on-navigation-back.html:
+        * fast/events/onunload-back-to-page-cache.html:
+        * fast/events/pagehide-timeout-expected.txt:
+        * fast/events/pagehide-timeout.html:
+        * fast/events/pagehide-xhr-open-expected.txt:
+        * fast/events/pagehide-xhr-open.html:
+        * fast/events/pageshow-pagehide-on-back-cached-with-frames.html:
+        * fast/events/pageshow-pagehide-on-back-cached.html:
+        * fast/events/suspend-timers-expected.txt:
+        * fast/events/suspend-timers.html:
+        * fast/forms/autocomplete-off-with-default-value-does-not-clear.html:
+        * fast/frames/frame-crash-with-page-cache.html:
+        * fast/frames/frame-unload-navigate-and-setTimeout-assert-fail.html:
+        * fast/frames/page-hide-document-open.html:
+        * fast/frames/restoring-page-cache-should-not-run-scripts-via-style-update.html:
+        * fast/frames/restoring-page-cache-should-not-run-scripts.html:
+        * fast/harness/page-cache-crash-on-data-urls.html:
+        * fast/harness/use-page-cache-expected.txt:
+        * fast/harness/use-page-cache.html:
+        * fast/history/back-from-page-with-focused-iframe.html:
+        * fast/history/go-back-to-iframe-with-plugin.html:
+        * fast/history/go-back-to-object-subframe.html:
+        * fast/history/history-back-while-pdf-in-pagecache.html:
+        * fast/history/page-cache-MessagePort-pending-message.html:
+        * fast/history/page-cache-after-window-open.html:
+        * fast/history/page-cache-back-navigation-crash.html:
+        * fast/history/page-cache-clearing-expected.txt:
+        * fast/history/page-cache-clearing.html:
+        * fast/history/page-cache-closed-audiocontext.html:
+        * fast/history/page-cache-createObjectURL-using-open-panel.html:
+        * fast/history/page-cache-createObjectURL.html:
+        * fast/history/page-cache-destroy-document.html:
+        * fast/history/page-cache-element-state-focused.html:
+        * fast/history/page-cache-execute-script-during-restore.html:
+        * fast/history/page-cache-geolocation-active-oneshot.html:
+        * fast/history/page-cache-geolocation-active-watcher.html:
+        * fast/history/page-cache-geolocation.html:
+        * fast/history/page-cache-indexed-closed-db.html:
+        * fast/history/page-cache-indexed-opened-db.html:
+        * fast/history/page-cache-media-source-closed-2.html:
+        * fast/history/page-cache-media-source-closed.html:
+        * fast/history/page-cache-media-source-opened.html:
+        * fast/history/page-cache-navigate-during-restore.html:
+        * fast/history/page-cache-notification-non-suspendable.html:
+        * fast/history/page-cache-notification-suspendable.html:
+        * fast/history/page-cache-removed-source-buffer.html:
+        * fast/history/page-cache-running-audiocontext.html:
+        * fast/history/page-cache-suspended-audiocontext.html:
+        * fast/history/page-cache-webdatabase-no-transaction-db-expected.txt:
+        * fast/history/page-cache-webdatabase-no-transaction-db.html:
+        * fast/history/page-cache-webdatabase-pending-transaction.html:
+        * fast/history/page-cache-with-opener.html:
+        * fast/history/pagehide-remove-iframe-crash.html:
+        * fast/history/resources/page-cache-window-with-iframe.html:
+        * fast/history/resources/page-cache-window-with-opener.html:
+        * fast/history/timed-refresh-in-cached-frame.html:
+        * fast/images/animated-gif-restored-from-bfcache.html:
+        * fast/loader/frames-with-unload-handlers-in-page-cache.html:
+        * fast/loader/image-in-page-cache.html:
+        * fast/loader/input-element-page-cache-crash.html:
+        * fast/loader/navigate-with-new-target-after-back-forward-navigation.html:
+        * fast/loader/navigate-with-post-to-new-target-after-back-forward-navigation.html:
+        * fast/loader/scroll-position-restored-on-back.html:
+        * fast/loader/stateobjects/no-popstate-when-back-to-stateless-entry-with-page-cache.html:
+        * fast/loader/stateobjects/popstate-fires-with-page-cache.html:
+        * fast/loader/unschedule-relayout-after-unload.html:
+        * fast/loader/window-properties-restored-from-page-cache.html:
+        * fast/overflow/horizontal-scroll-after-back.html:
+        * fast/scrolling/iframe-scrollable-after-back.html:
+        * fast/scrolling/ios/scroll-events-back-forward-after-pageshow.html:
+        * fast/scrolling/ios/scroll-events-back-forward.html:
+        * fast/scrolling/ios/touch-scroll-back-forward.html:
+        * fast/scrolling/overflow-scrollable-after-back.html:
+        * fast/scrolling/page-cache-back-overflow-scroll-restore.html:
+        * fast/text-autosizing/ios/text-autosizing-after-back.html:
+        * fast/viewport/ios/viewport-shrink-to-fit-on-new-navigation.html:
+        * fast/viewport/viewport-128.html:
+        * http/tests/cache/display-image-unset-allows-cached-image-load.html:
+        * http/tests/loading/main-resource-delegates-on-back-navigation-expected.txt:
+        * http/tests/loading/main-resource-delegates-on-back-navigation.html:
+        * http/tests/loading/unfinished-load-back-to-cached-page-callbacks.html:
+        * http/tests/loading/unfinished-main-resource-back-to-cached-page-callbacks.html:
+        * http/tests/media/reload-after-dialog.html:
+        * http/tests/navigation/go-back-to-error-page.html:
+        * http/tests/navigation/https-in-page-cache.html:
+        * http/tests/navigation/https-no-store-subframe-in-page-cache.html:
+        * http/tests/navigation/image-load-in-pagehide-handler.html:
+        * http/tests/navigation/page-cache-fragment-referrer.html:
+        * http/tests/navigation/page-cache-iframe-no-current-historyItem.html:
+        * http/tests/navigation/page-cache-iframe-provisional-load-async-delegates.html:
+        * http/tests/navigation/page-cache-iframe-provisional-load.html:
+        * http/tests/navigation/page-cache-pending-image-load-cache-partition.html:
+        * http/tests/navigation/page-cache-pending-image-load.html:
+        * http/tests/navigation/page-cache-pending-ping-load-cross-origin.html:
+        * http/tests/navigation/page-cache-pending-ping-load-same-origin.html:
+        * http/tests/navigation/page-cache-xhr-in-pagehide-expected.txt:
+        * http/tests/navigation/page-cache-xhr-in-pagehide.html:
+        * http/tests/navigation/page-cache-xhr.html:
+        * http/tests/navigation/resources/https-in-page-cache-1.php:
+        * http/tests/navigation/resources/https-in-page-cache-2.php:
+        * http/tests/navigation/resources/https-in-page-cache-3.html:
+        * http/tests/navigation/resources/https-no-store-subframe-in-page-cache.html:
+        * http/tests/navigation/subframe-pagehide-handler-starts-load.html:
+        * http/tests/navigation/subframe-pagehide-handler-starts-load2.html:
+        * http/tests/security/cross-origin-window-open-insert-script.html:
+        * http/tests/security/cross-origin-window-open-javascript-url.html:
+        * http/tests/security/navigate-when-restoring-cached-page.html:
+        * http/tests/security/xss-DENIED-click-and-form-submission-from-inactive-domwindow.html:
+        * http/tests/security/xss-DENIED-script-inject-into-inactive-window.html:
+        * http/tests/security/xss-DENIED-script-inject-into-inactive-window2-pson.html:
+        * http/tests/security/xss-DENIED-script-inject-into-inactive-window2.html:
+        * http/tests/security/xss-DENIED-script-inject-into-inactive-window3.html:
+        * http/tests/websocket/tests/hybi/closed-when-entering-page-cache.html:
+        * http/tests/websocket/tests/hybi/stop-on-resume-in-error-handler.html:
+        * http/tests/workers/service/client-added-to-clients-when-restored-from-page-cache.html:
+        * http/tests/workers/service/client-removed-from-clients-while-in-page-cache.html:
+        * http/wpt/beacon/support/sendBeacon-onpagehide-window.html:
+        * legacy-animation-engine/animations/resume-after-page-cache.html:
+        * loader/go-back-cached-main-resource.html:
+        * loader/go-back-to-different-window-size.html:
+        * media/crash-closing-page-with-media-as-plugin-fallback.html:
+        * media/restore-from-page-cache.html:
+        * platform/ios/ios/fixed/fixed-back-forward.html:
+        * plugins/crash-restoring-plugin-page-from-page-cache.html:
+        * plugins/frameset-with-plugin-frame.html:
+        * plugins/netscape-plugin-page-cache-works.html:
+        * swipe/basic-cached-back-swipe.html:
+        * swipe/main-frame-pinning-requirement.html:
+        * swipe/pushState-cached-back-swipe.html:
+        * swipe/pushState-programmatic-back-while-swiping-crash.html:
+        * swipe/pushstate-with-manual-scrollrestoration.html:
+        * tiled-drawing/scrolling/null-parent-back-crash.html:
+        * tiled-drawing/tiled-drawing-scroll-position-page-cache-restoration.html:
+
 2019-09-26  Kate Cheney  <katherine_cheney@apple.com>
 
         Enable LayoutTests using ResourceLoadStatistics SQLite backend (195420)
index af1de03..a6622ee 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <style>
 @-webkit-keyframes bounce {
     from {
@@ -25,7 +26,6 @@ var hasNavigated = false;
 function sawIteration(event) {
     if (hasNavigated) {
         document.getElementById("results").innerText = "PASS: Saw iteration after navigation";
-        window.testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 0);
         testRunner.notifyDone();
     }
 }
@@ -42,7 +42,6 @@ function startTest() {
 if (window.testRunner) {
     window.testRunner.dumpAsText();
     window.testRunner.waitUntilDone();
-    window.testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
 }
 
 window.addEventListener("load", startTest, false);
index 7785473..3b61a44 100644 (file)
@@ -1,4 +1,4 @@
-<!DOCTYPE html> <!-- webkit-test-runner [ useAcceleratedDrawing=true ] -->
+<!DOCTYPE html> <!-- webkit-test-runner [ useAcceleratedDrawing=true enablePageCache=true ] -->
 
 <html>
 <head>
@@ -19,7 +19,6 @@
         if (window.testRunner) {
             testRunner.dumpAsText();
             testRunner.waitUntilDone();
-            window.testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
         }
         
         function doOnFirstLoad()
index 423dcc3..96c698f 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <head>
@@ -49,7 +50,6 @@
     if (window.testRunner) {
         window.testRunner.dumpAsText();
         window.testRunner.waitUntilDone();
-        window.testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
     }
 
     function finishTest() {
index 1460e76..8f68bcd 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <style>
 .outer { position: fixed; }
 .inner { position: absolute; }
@@ -8,7 +9,6 @@ Test passes if it doesn't crash.
 if (window.testRunner) {
     window.testRunner.dumpAsText();
     window.testRunner.waitUntilDone();
-    window.testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
 }
 
 window.addEventListener("pageshow", function(event) {
index 65a8b10..5695e74 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <head>
@@ -15,11 +16,8 @@ function handleOnPageShow(pageTransitionEvent)
     testRunner.queueBackNavigation(1);
 }
 
-if (window.testRunner) {
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
-
+if (window.testRunner)
     window.onpageshow = handleOnPageShow;
-}
 </script>
 </head>
 <body>
index 4af33ab..38877cb 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <html>
 <head>
 <title>Test what happens when navigating from a page with unconfirmed inline input when the page is cacheable</title>
@@ -7,10 +8,8 @@
 <script>
 jsTestIsAsync = true;
 
-if (window.testRunner) {
+if (window.testRunner)
     testRunner.setCanOpenWindows();
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
-}
 
 // Window we will be controlling.
 var target;
index 8d472f1..7a20a0c 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!doctype html>
 <html>
 <style>
@@ -22,7 +23,6 @@ function runTest() {
     if (window.testRunner) {
         testRunner.dumpAsText();
         testRunner.waitUntilDone();
-        testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
     }
     document.fonts.loadFont({ font: '10px TestFont', onsuccess: onsuccess, onerror: onerror });
 }
index cf7497f..59e7383 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <html>
 <head>
 <script src="../../../resources/js-test-pre.js"></script>
@@ -9,7 +10,6 @@ description('Tests that pages that use DeviceMotion are not put in the page cach
 if (window.testRunner) {
     testRunner.waitUntilDone();
     testRunner.setCanOpenWindows();
-    testRunner.overridePreference('WebKitUsesPageCachePreferenceKey', 1);
 } else
     debug('This test can not be run without the TestRunner');
 
index 9f9774a..238b371 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <html>
 <head>
 <script src="../../../resources/js-test-pre.js"></script>
@@ -6,11 +7,6 @@
 <script>
 description('Tests for a crash where an event is fired after the page has been navigated away when the original page is in the page cache.');
 
-if (window.testRunner)
-    testRunner.overridePreference('WebKitUsesPageCachePreferenceKey', 1);
-else
-    debug('This test can not be run without the TestRunner');
-
 document.body.onload = function() {
     window.addEventListener('deviceorientation', function() { } );
     window.location = "resources/event-after-navigation-new.html";
index c6a215b..6651f51 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <html>
 <head>
 <script src="../../../resources/js-test-pre.js"></script>
@@ -9,7 +10,6 @@ description('Tests that pages that use DeviceOrientation are not put in the page
 if (window.testRunner) {
     testRunner.waitUntilDone();
     testRunner.setCanOpenWindows();
-    testRunner.overridePreference('WebKitUsesPageCachePreferenceKey', 1);
 } else
     debug('This test can not be run without the TestRunner');
 
index e0905af..302a424 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <html>
 <script>
 var timeoutValue = 100; //ms
@@ -28,7 +29,6 @@ function runTest() {
     if (window.testRunner) {
       testRunner.dumpAsText();
       testRunner.waitUntilDone();
-      testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
     }
     // Location changes need to happen outside the onload handler to generate history entries.
     setTimeout(function() {
index 38c4b62..f0184f3 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
 <html>
 <head>
@@ -11,11 +12,8 @@ onpageshow = function(event) {
     if (window.history.state == 'navigated') {
         testPassed('WebTiming asserts in FrameLoader.cpp did not fire');
         finishJSTest();
-    } else {
-        if (window.testRunner)
-            testRunner.overridePreference('WebKitUsesPageCachePreferenceKey', 1);
+    } else
         setTimeout(function() {window.history.replaceState('navigated', ''); location.href = 'data:text/html,<script>onunload=function() {},onload=function(){history.back();}<' + '/script>';}, 0);
-    }
 }
 
 var jsTestIsAsync = true;
index 5cc33d5..99cc062 100644 (file)
@@ -1,7 +1,7 @@
-CONSOLE MESSAGE: line 16: Creating timeout in pagehide
+CONSOLE MESSAGE: line 14: Creating timeout in pagehide
 CONSOLE MESSAGE: line 5: Loaded pagehide-timeout-go-back.html, going back
-CONSOLE MESSAGE: line 29: Restored page from page cache.
-CONSOLE MESSAGE: line 20: Timeout created in pagehide fired
+CONSOLE MESSAGE: line 27: Restored page from page cache.
+CONSOLE MESSAGE: line 18: Timeout created in pagehide fired
 Tests that JS execution is suspended after the pagehide event is fired, so that timers created within it will not fire while the document is in the page cache.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
index d9f24d7..4801ee8 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <html>
 <script src="../../resources/js-test-pre.js"></script>
 <body>
@@ -5,9 +6,6 @@
 <script type="text/javascript">
 description('Tests that JS execution is suspended after the pagehide event is fired, so that timers created within it will not fire while the document is in the page cache.');
 
-if (window.testRunner)
-    testRunner.overridePreference('WebKitUsesPageCachePreferenceKey', 1);
-    
 onpagehide = function()
 {
     // Don't try to create the timeout again if the test is complete and we're
index 334392f..f883292 100644 (file)
@@ -1,6 +1,6 @@
 CONSOLE MESSAGE: line 6: XMLHttpRequest in subframe-1 created
 CONSOLE MESSAGE: line 5: Loaded pagehide-timeout-go-back.html, going back
-CONSOLE MESSAGE: line 17: Restored page from page cache.
+CONSOLE MESSAGE: line 14: Restored page from page cache.
 Tries to trigger an assert in xmlhttprequest during pagehide.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
index 2be8101..a3b9b5c 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <html>
 <script src="../../resources/js-test-pre.js"></script>
 <body>
@@ -7,10 +8,6 @@
 <script type="text/javascript">
 description('Tries to trigger an assert in xmlhttprequest during pagehide.');
 
-if (window.testRunner)
-    testRunner.overridePreference('WebKitUsesPageCachePreferenceKey', 1);
-
-
 onpageshow = function(event)
 {
     if (event.persisted) {
index c399c58..421286d 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <html>
 <body>
 Test pageshow/pagehide event behavior when navigating away from a page with frames, putting the page in the page cache, then back to it.
@@ -8,7 +9,6 @@ Test pageshow/pagehide event behavior when navigating away from a page with fram
 if (window.testRunner) {
     testRunner.dumpAsText();
     testRunner.waitUntilDone();
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
 }
 
 // We explicitly chain the loading of the subframes to ensure consistent test results between runs.
index e99815b..cf921bf 100644 (file)
@@ -1,9 +1,9 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <p>Test pageshow/pagehide event behavior when navigating back to an cached page.</p>
 <script>
 if (window.testRunner) {
     testRunner.dumpAsText();
     testRunner.waitUntilDone();
-      testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
 }
 
 window.onload = function(evt) {
index 47f04c7..e57bc86 100644 (file)
@@ -1,6 +1,6 @@
 CONSOLE MESSAGE: line 6: Timeout in subframe-1 created
 CONSOLE MESSAGE: line 5: Loaded pagehide-timeout-go-back.html, going back
-CONSOLE MESSAGE: line 30: Restored page from page cache.
+CONSOLE MESSAGE: line 27: Restored page from page cache.
 ALERT: Timeout created in subframe-1.html fired
 Tests that all JS timers are suspended after the pagehide event is fired, so that timers created within it will not fire while the document is in the page cache.
 
index 8979e29..3c85f48 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <head>
 <script type="text/javascript">
 description('Tests that all JS timers are suspended after the pagehide event is fired, so that timers created within it will not fire while the document is in the page cache.');
 
-if (window.testRunner)
-    testRunner.overridePreference('WebKitUsesPageCachePreferenceKey', 1);
-
-
 onpageshow = function(event)
 {
     if (event.persisted) {
index 44d0762..b3fdd2a 100644 (file)
@@ -1,7 +1,7 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <script>
 
 if (window.testRunner) {
-       testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
        testRunner.dumpAsText();
        testRunner.waitUntilDone();
 }
index 1e149ff..a299cf8 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <html>
 <script>
 window.finish = function()
@@ -20,7 +21,6 @@ function test() {
         testRunner.dumpAsText();
         testRunner.waitUntilDone();
         testRunner.setCanOpenWindows();
-        testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
     }
     log("open page-1");
     window.open("resources/cached-page-1.html");
index 12091ef..3832d67 100644 (file)
@@ -1,10 +1,10 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <body>
 <script>
 if (window.testRunner) {
     testRunner.dumpAsText();
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
     testRunner.waitUntilDone();
 }
 </script>
index 5fdeff6..95c14ab 100644 (file)
@@ -1,9 +1,9 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 Passes if it does not crash.
 <script>
 if (window.testRunner) {
     testRunner.dumpAsText();
-    testRunner.overridePreference('WebKitUsesPageCachePreferenceKey', 1);
     testRunner.setCanOpenWindows();
     testRunner.waitUntilDone();
 }
index a8e5d4c..db1d14e 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <body>
@@ -9,7 +10,6 @@ if (window.testRunner) {
     testRunner.dumpAsText();
     testRunner.waitUntilDone();
     testRunner.setCanOpenWindows();
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
     internals.settings.setPageCacheSupportsPlugins(true);
 }
 
index c0083bd..c145b50 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <body>
@@ -9,7 +10,6 @@ if (window.testRunner) {
     testRunner.dumpAsText();
     testRunner.waitUntilDone();
     testRunner.setCanOpenWindows();
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
 }
 
 let newWindow;
index 737e4ca..1187c60 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <html>
 <script>
 window.finish = function()
@@ -21,7 +22,6 @@ function test()
         testRunner.dumpAsText();
         testRunner.waitUntilDone();
         testRunner.setCanOpenWindows();
-        testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
     }
     log("open page with data urls");
     window.open("resources/cached-page-with-data-urls.html");
index dbb6fa1..aba22d8 100644 (file)
@@ -1,4 +1,4 @@
-This test uses testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1); to enable back-forward WebKit page cache for the duration of the test. The test enables cache, navigates to page-1, then to page-2 and then does history.back() to page-1. On navigation back to page-1, test verifies that previously-initialized timer continues to fire and onload is not called again. If test fails it hangs or outputs 'FAIL' below.
+This test enables back-forward WebKit page cache for the duration of the test. The test enables cache, navigates to page-1, then to page-2 and then does history.back() to page-1. On navigation back to page-1, test verifies that previously-initialized timer continues to fire and onload is not called again. If test fails it hangs or outputs 'FAIL' below.
 
 open page-1
 page-1, about to navigate to page-2.
index 2564b60..a023bca 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <html>
 <script>
 window.finish = function()
@@ -27,7 +28,6 @@ function test()
         testRunner.dumpAsText();
         testRunner.waitUntilDone();
         testRunner.setCanOpenWindows();
-        testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
     }
     log("open page-1");
     window.open("resources/cached-page-1.html");
@@ -35,7 +35,7 @@ function test()
 </script>
 
 <body onload="test()">
-<p>This test uses testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1); to enable
+<p>This test  enables
 back-forward WebKit page cache for the duration of the test.
 The test enables cache, navigates to page-1, then to page-2 and then does history.back() to page-1.
 On navigation back to page-1, test verifies that previously-initialized timer continues to fire and
index 4d4fca9..6d3f84b 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <head>
@@ -30,7 +31,6 @@ window.onpageshow = function (pageTransitionEvent)
     } else {
         // Newly loaded
         if (window.testRunner) {
-            testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
             testRunner.dumpAsText();
             testRunner.dumpBackForwardList();
             testRunner.waitUntilDone();
index b3530db..3c44ad5 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
   <head>
@@ -13,7 +14,6 @@
 
     if (window.testRunner) {
       testRunner.dumpAsText();
-      testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
       testRunner.waitUntilDone();
     }
     window.onpageshow = runTest;
index 580a42f..f08d056 100644 (file)
@@ -1,10 +1,10 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <head>
 <script>
 if (window.testRunner) {
     testRunner.dumpAsText();
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
     testRunner.waitUntilDone();
 }
 
index 37158a6..1b581fa 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <head>
 
     function runTest() {
         if (location.hash == "") {
-            if (window.testRunner) {
-                testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
+            if (window.testRunner)
                 testRunner.waitUntilDone();
-            }
 
             history.pushState({ }, "", window.location + "#1");
             setTimeout("window.location.href = 'resources/history-back-for-pfd-test.html'", 0);
index c9a1867..cecf604 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <body>
@@ -6,9 +7,6 @@
 description('Tests that a page that has a MessagePort with a pending message can enter PageCache.');
 window.jsTestIsAsync = true;
 
-if (window.testRunner)
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
-
 let afterPageCacheRestore = false;
 
 window.addEventListener("pageshow", function(event) {
index 595ea41..fcd5de4 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <body>
@@ -6,10 +7,8 @@
 description("Tests that a page that has called window.open() goes into the page cache.");
 window.jsTestIsAsync = true;
 
-if (window.testRunner) {
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
+if (window.testRunner)
     testRunner.setCanOpenWindows();
-}
 
 window.addEventListener("pageshow", function(event) {
     if (!window.sessionStorage.didStartPageCacheAfterWindowOpenTest) {
index 7a59841..02f8170 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <body>
@@ -6,10 +7,8 @@
 description('Tests that removing a frame in a detached document after navigation does not cause a crash on navigating back');
 window.jsTestIsAsync = true;
 
-if (window.testRunner) {
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
+if (window.testRunner)
     testRunner.setCanOpenWindows();
-}
 
 function removeFrameInChild()
 {
index 4f47c7b..6279da9 100644 (file)
@@ -6,7 +6,7 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
 pageshow - not from cache
 pagehide - entering cache
 pageshow - from cache
-PASS window.internals.pageCacheSize() is 1
+PASS window.internals.pageCacheSize() > 0 is true
 window.internals.clearPageCache()
 PASS window.internals.pageCacheSize() is 0
 PASS successfullyParsed is true
index 4d10c5a..8aa972a 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <body>
@@ -6,17 +7,13 @@
 description("Tests that clearing the page cache doesn't leave pages in the cache.");
 window.jsTestIsAsync = true;
 
-// Enable page cache.
-if (window.testRunner)
-    window.testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
-
 if (!window.internals)
     debug("This test requires window.internals");
 
 window.addEventListener("pageshow", function(event) {
     debug("pageshow - " + (event.persisted ? "" : "not ") + "from cache");
     if (event.persisted) {
-        shouldBe("window.internals.pageCacheSize()", "1");
+        shouldBeTrue("window.internals.pageCacheSize() > 0");
         evalAndLog("window.internals.clearPageCache()");
         shouldBe("window.internals.pageCacheSize()", "0");
         finishJSTest();
index 060842d..ffe5b29 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <body>
@@ -10,9 +11,6 @@ window.jsTestIsAsync = true;
 var sampleRate = 44100.0;
 var lengthInSeconds = 2;
 
-if (window.testRunner)
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
-
 window.addEventListener("pageshow", function(event) {
     debug("pageshow - " + (event.persisted ? "" : "not ") + "from cache");
 
index 77abed6..bfcc2e9 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <body>
@@ -13,9 +14,6 @@ description('Tests that a page calling URL.createObjectURL() can use the page ca
 window.jsTestIsAsync = true;
 var blobURL = null;
 
-if (window.testRunner)
-    window.testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
-
 function onInputFileChange()
 {
     var file = document.getElementById("file").files[0];
index fcb5901..a628c82 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <body>
@@ -12,9 +13,6 @@ description('Tests that a page calling URL.createObjectURL() can use the page ca
 window.jsTestIsAsync = true;
 var blobURL = null;
 
-if (window.testRunner)
-    window.testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
-
 function onInputFileChange()
 {
     var file = document.getElementById("file").files[0];
index b5f0beb..6d1d7bf 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
 <html>
 <head>
@@ -8,10 +9,8 @@
 <div id="console"></div>
 <script>
 description('Tests that page can safely remove an iframe durin pagehide event.');
-if (window.testRunner) {
-    window.testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
+if (window.testRunner)
     window.testRunner.waitUntilDone();
-}
 
 window.addEventListener("pagehide", function(event) {
     debug("pagehide - entering cache");
index a40e934..fdef5ef 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <head>
@@ -8,10 +9,8 @@
 </style>
 <script>
     function runTest() {
-        if (window.testRunner) {
-            testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
+        if (window.testRunner)
             testRunner.waitUntilDone();
-        }
 
         window.onpageshow = function(e) {
             if (e.persisted) {
index 46621d1..2e34f49 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <body>
@@ -9,7 +10,6 @@
 <script>
 
 if (window.testRunner) {
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
     testRunner.clearBackForwardList();
     testRunner.dumpAsText();
     testRunner.waitUntilDone();
index d6db30f..0ce4803 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <body>
@@ -12,10 +13,8 @@ var mockAccuracy = 100.0;
 
 var stage = "before_restore";
 
-if (window.testRunner) {
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
+if (window.testRunner)
     testRunner.setMockGeolocationPosition(mockLatitude, mockLongitude, mockAccuracy);
-}
 
 window.addEventListener("pageshow", function(event) {
     debug("pageshow - " + (event.persisted ? "" : "not ") + "from cache");
index a873c4d..94c0772 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <body>
@@ -13,7 +14,6 @@ var mockAccuracy = 100.0;
 var stage = "before_restore";
 
 if (window.testRunner) {
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
     testRunner.setGeolocationPermission(true);
     testRunner.setMockGeolocationPosition(mockLatitude, mockLongitude, mockAccuracy);
 }
index 3bffa77..4846ab6 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
 <html>
 <head>
@@ -28,12 +29,8 @@ window.addEventListener("pagehide", function(event) {
 }, false);
 
 window.addEventListener('load', function() {
-
-    // Enable the PageCache and make this an async test.
-    if (window.testRunner) {
-        window.testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
+    if (window.testRunner)
         window.testRunner.waitUntilDone();
-    }
 
     // Access geolocation. It is enough to create the geolocation object.
     debug(navigator.geolocation);
index 6fd0601..cc09761 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <body>
@@ -6,9 +7,6 @@
 description('Tests that a page with a closed IndexedDB database goes into the page cache.');
 window.jsTestIsAsync = true;
 
-if (window.testRunner)
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
-
 window.addEventListener("pageshow", function(event) {
     debug("pageshow - " + (event.persisted ? "" : "not ") + "from cache");
 
index dfdde66..13f61d8 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <body>
@@ -6,9 +7,6 @@
 description('Tests that a page with an open IndexedDB database does not go into the page cache.');
 window.jsTestIsAsync = true;
 
-if (window.testRunner)
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
-
 window.addEventListener("pageshow", function(event) {
     debug("pageshow - " + (event.persisted ? "" : "not ") + "from cache");
     if (!window.sessionStorage.page_cache_open_indexeddb_test_started)
index 8828399..d8e3c4f 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <body>
@@ -6,9 +7,6 @@
 description('Tests that a page with a closed MediaSource goes into the page cache.');
 window.jsTestIsAsync = true;
 
-if (window.testRunner)
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
-
 window.addEventListener("pageshow", function(event) {
     debug("pageshow - " + (event.persisted ? "" : "not ") + "from cache");
 
index f77ae5f..818f026 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <body>
@@ -6,9 +7,6 @@
 description('Tests that a page with a closed MediaSource goes into the page cache.');
 window.jsTestIsAsync = true;
 
-if (window.testRunner)
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
-
 window.addEventListener("pageshow", function(event) {
     debug("pageshow - " + (event.persisted ? "" : "not ") + "from cache");
 
index 208396f..955af95 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <body>
@@ -6,9 +7,6 @@
 description('Tests that a page with a closed MediaSource goes into the page cache.');
 window.jsTestIsAsync = true;
 
-if (window.testRunner)
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
-
 window.addEventListener("pageshow", function(event) {
     debug("pageshow - " + (event.persisted ? "" : "not ") + "from cache");
     if (!window.sessionStorage.page_cache_open_mediasource_test_started)
index c3a6cec..97967ae 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <body>
@@ -9,7 +10,6 @@
 <script>
 
 if (window.testRunner) {
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
     testRunner.clearBackForwardList();
     testRunner.dumpAsText();
     testRunner.waitUntilDone();
index 5d7f5ca..a62e97b 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <body>
@@ -6,10 +7,8 @@
 description('Tests that a page with a notification that is showing does not enter page cache.');
 window.jsTestIsAsync = true;
 
-if (window.testRunner) {
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
+if (window.testRunner)
     testRunner.grantWebNotificationPermission("file://");
-}
 
 window.addEventListener("pageshow", function(event) {
     debug("pageshow - " + (event.persisted ? "" : "not ") + "from cache");
index 3f8c4e5..51cba5d 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <body>
@@ -6,10 +7,8 @@
 description('Tests that notifications do not prevent the Page from entering page cache if they are idle or closed.');
 window.jsTestIsAsync = true;
 
-if (window.testRunner) {
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
+if (window.testRunner)
     testRunner.grantWebNotificationPermission("file://");
-}
 
 window.addEventListener("pageshow", function(event) {
     debug("pageshow - " + (event.persisted ? "" : "not ") + "from cache");
index e3c10ca..0e28acf 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <body>
@@ -6,9 +7,6 @@
 description('Tests that a SourceBuffer removed from its MediaSource does not prevent a Page from entering PageCache');
 window.jsTestIsAsync = true;
 
-if (window.testRunner)
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
-
 window.addEventListener("pageshow", function(event) {
     debug("pageshow - " + (event.persisted ? "" : "not ") + "from cache");
 
index ec2fee9..79b5255 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <body>
@@ -6,9 +7,6 @@
 description('Tests that a page with a running AudioContext does not go into the page cache.');
 window.jsTestIsAsync = true;
 
-if (window.testRunner)
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
-
 window.addEventListener("pageshow", function(event) {
     debug("pageshow - " + (event.persisted ? "" : "not ") + "from cache");
 
index 44f4c60..3154401 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <body>
@@ -6,9 +7,6 @@
 description('Tests that a page with a suspended AudioContext goes into the page cache.');
 window.jsTestIsAsync = true;
 
-if (window.testRunner)
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
-
 window.addEventListener("pageshow", function(event) {
     debug("pageshow - " + (event.persisted ? "" : "not ") + "from cache");
 
index 66c0aba..1dd3636 100644 (file)
@@ -1,4 +1,4 @@
-CONSOLE MESSAGE: line 32: Web SQL is deprecated. Please use IndexedDB instead.
+CONSOLE MESSAGE: line 31: Web SQL is deprecated. Please use IndexedDB instead.
 Tests that a page with an open WebDatabase with no pending transaction goes into the page cache.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
index 72f6a5f..a4f5655 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <body>
@@ -6,10 +7,8 @@
 description('Tests that a page with an open WebDatabase with no pending transaction goes into the page cache.');
 window.jsTestIsAsync = true;
 
-if (window.testRunner) {
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
+if (window.testRunner)
     testRunner.clearAllDatabases();
-}
 
 window.addEventListener("pageshow", function(event) {
     debug("pageshow - " + (event.persisted ? "" : "not ") + "from cache");
index f34eb42..0eab23d 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <body>
@@ -6,10 +7,8 @@
 description('Tests that a page with an open WebDatabase that has pending transactions does not go into the page cache.');
 window.jsTestIsAsync = true;
 
-if (window.testRunner) {
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
+if (window.testRunner)
     testRunner.clearAllDatabases();
-}
 
 window.addEventListener("pageshow", function(event) {
     debug("pageshow - " + (event.persisted ? "" : "not ") + "from cache");
index 2098581..f8e40e4 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <body>
@@ -6,10 +7,8 @@
 description("Tests that a page that has a window opener goes into the page cache.");
 window.jsTestIsAsync = true;
 
-if (window.testRunner) {
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
+if (window.testRunner)
     testRunner.setCanOpenWindows();
-}
 
 window.addEventListener("load", function() {
     newWindow = open("resources/page-cache-window-with-opener.html", "one");
index c429b36..5cc5143 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <body>
@@ -6,8 +7,6 @@
 <script>
 description("Tests that we do not crash when deleting a subframe from the pagehide event handler.");
 jsTestIsAsync = true;
-if (window.testRunner)
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
 
 window.addEventListener("pageshow", function(event) {
     debug("pageshow - " + (event.persisted ? "" : "not ") + "from cache");
index c330e4e..fd62bd3 100644 (file)
@@ -1,12 +1,10 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <body>
 <script src="../../../resources/js-test-pre.js"></script>
 <iframe src="about:blank"></iframe>
 <script>
-if (window.testRunner)
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
-
 window.addEventListener("pageshow", function(event) {
     debug("pageshow - " + (event.persisted ? "" : "not ") + "from cache");
 
index 4b5dc71..ba63011 100644 (file)
@@ -1,11 +1,9 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <body>
 <script src="../../../resources/js-test-pre.js"></script>
 <script>
-if (window.testRunner)
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
-
 window.addEventListener("pageshow", function(event) {
     if (!window.sessionStorage.didStartPageCacheWindowWithOpenerTest) {
         if (event.persisted)
index fcd509c..2428016 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <body onload="redirect()">
 <!-- Needs to take two seconds, because a faster refresh would result in not creating a b/f item for the navigation -->
 <iframe src='data:text/html,<meta http-equiv="Refresh" content="2; URL=about:blank"><script>if (window.testRunner) { window.onpagehide=function(e){alert(&apos;pagehide &apos; + e.persisted)}; }</script>'></iframe>
@@ -6,7 +7,6 @@
 if (window.testRunner) {
     testRunner.dumpAsText();
     testRunner.waitUntilDone();
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
 }
 
 function redirect()
index ab14351..828bcba 100644 (file)
@@ -1,8 +1,7 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <script>
-    if (window.testRunner) {
+    if (window.testRunner)
         testRunner.dumpAsText();
-        testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
-    }
 
     function runTest() {
         if (window.internals && window.testRunner) {
index 8297733..b81f877 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <html>
 <head>
 <script>
@@ -5,7 +6,6 @@
 if (window.testRunner) {
     testRunner.dumpAsText();
     testRunner.waitUntilDone();
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
 }
 
 window.onload = function() {
index c5b02eb..7d43103 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <head>
@@ -10,7 +11,6 @@ function runTest() {
                testRunner.dumpAsText();
                testRunner.waitUntilDone();
                testRunner.setCanOpenWindows();
-               testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
        }
 
        // This test open two windows. One primary window will load animated-image.html.
@@ -67,4 +67,4 @@ successfullyParsed = true;
 </script>
 <script src="../../resources/js-test-post.js"></script>
 </body>
-</html>
\ No newline at end of file
+</html>
index e36db20..c86b258 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <html>
 <head>
 <script>
@@ -5,7 +6,6 @@
 if (window.testRunner) {
     testRunner.dumpAsText();
     testRunner.waitUntilDone();
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
 }
 
 function runTest()
index 35ccb34..c58c726 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <body>
@@ -8,7 +9,6 @@ if (window.testRunner) {
     testRunner.waitUntilDone();
     testRunner.setCanOpenWindows();
     testRunner.setCloseRemainingWindowsWhenComplete();
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
 }
 
 if (location.search == '?third') {
index 076d9eb..2fc2395 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <body>
@@ -8,7 +9,6 @@ if (window.testRunner) {
     testRunner.waitUntilDone();
     testRunner.setCanOpenWindows();
     testRunner.setCloseRemainingWindowsWhenComplete();
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
 }
 
 if (location.search == '?third') {
index 73f58df..780ec60 100644 (file)
@@ -1,13 +1,12 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <html>
 <head>
 <script>
-
 function navigate()
 {
     if (location.hash == "") {
         if (window.testRunner) {
             testRunner.dumpAsText();
-            testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
             testRunner.waitUntilDone();
         }
 
index 4762ca5..bb0460b 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <body>
@@ -11,10 +12,8 @@ var testWindow;
 
 onload = function()
 {
-    if (window.testRunner) {
+    if (window.testRunner)
         testRunner.setCanOpenWindows();
-        testRunner.overridePreference('WebKitUsesPageCachePreferenceKey', 1);
-    }
     testWindow = window.open('resources/no-popstate-when-back-to-stateless-entry-1.html');
     if (!testWindow)
         testFailed('Could not open test window');
index 61df09b..5403c1f 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <body>
@@ -11,10 +12,8 @@ var testWindow;
 
 onload = function()
 {
-    if (window.testRunner) {
+    if (window.testRunner)
         testRunner.setCanOpenWindows();
-        testRunner.overridePreference('WebKitUsesPageCachePreferenceKey', 1);
-    }
     testWindow = window.open('resources/popstate-fires-with-page-cache-1.html');
     if (!testWindow)
         testFailed('Could not open test window');
index b84188c..692c706 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <html>
 <body>
 <pre id="log"></pre>
@@ -7,7 +8,6 @@
 if (window.testRunner) {
     testRunner.dumpAsText();
     testRunner.waitUntilDone();
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
 }
 
 window.onpageshow = function(evt) {
index 42b0e7f..93435a5 100644 (file)
@@ -1,8 +1,8 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <script>
 if (window.testRunner) {
        testRunner.dumpAsText();
        testRunner.waitUntilDone();
-       testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
 }
 
 var cachedApplicationCache = window.applicationCache;
@@ -107,4 +107,4 @@ window.onpageshow = function(evt) {
 This test makes sure that various properties on the window object are correctly reconnected after restoring a page from the page cache.<br>
 <div id="outputDiv"></div><br>
 <div id="errorDiv"></div>
-</body>
\ No newline at end of file
+</body>
index 8a6799b..14a7d9b 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <html>
 <script>
 
@@ -28,7 +29,6 @@ function runTestStep()
     if (window.testRunner) {
         testRunner.dumpAsText();
         testRunner.waitUntilDone();
-        testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
     }
     window.setTimeout("navigateAwayAndBack()", 200);
 }
index 87512da..f0065fd 100644 (file)
@@ -1,5 +1,5 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
-
 <html>
 <head>
     <style>
@@ -20,7 +20,6 @@
         if (window.testRunner) {
             testRunner.dumpAsText();
             testRunner.waitUntilDone();
-            testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
         }
         
         function logResult(s)
index 0d96a67..5a6bd89 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <head>
@@ -43,9 +44,6 @@ function onPageShow()
 
 function onPageLoad()
 {
-    if (window.testRunner)
-      testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
-
     // Navigate in a timeout to make sure we create a history entry.
     setTimeout(function() {
       window.location.href = 'resources/jump-back.html';
index aec74cd..e2f9866 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <head>
@@ -40,9 +41,6 @@ function onPageShow()
 
 function onPageLoad()
 {
-    if (window.testRunner)
-      testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
-
     // Navigate in a timeout to make sure we create a history entry.
     setTimeout(function() {
       window.location.href = 'resources/jump-back.html';
index 1fbc080..1165447 100644 (file)
@@ -1,4 +1,4 @@
-<!DOCTYPE html> <!-- webkit-test-runner [ internal:AsyncOverflowScrollingEnabled=true ] -->
+<!DOCTYPE html> <!-- webkit-test-runner [ internal:AsyncOverflowScrollingEnabled=true enablePageCache=true ] -->
 <html>
 <head>
   <script src="../../../resources/js-test-pre.js"></script>
@@ -42,9 +42,6 @@ function onPageShow()
 
 function onPageLoad()
 {
-    if (window.testRunner)
-      testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
-
     // Navigate in a timeout to make sure we create a history entry.
     setTimeout(function() {
       window.location.href = 'resources/jump-back.html';
index e1a81ff..07e135a 100644 (file)
@@ -1,5 +1,5 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
-
 <html>
 <head>
     <style>
@@ -20,7 +20,6 @@
         if (window.testRunner) {
             testRunner.dumpAsText();
             testRunner.waitUntilDone();
-            testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
         }
         
         function logResult(s)
index 10f7886..69176a7 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <style>
 #puffin {
     font: Ahem 10px;
@@ -23,7 +24,6 @@
 <script>
 testRunner.dumpAsText();
 testRunner.waitUntilDone();
-testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
 
 var testDiv = document.getElementById("puffin");
 
index aa87e25..e621c88 100644 (file)
@@ -1,4 +1,4 @@
-<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true ] -->
+<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true enablePageCache=true ] -->
 
 <html>
 <head>
 
         function runTest() 
         {
-            if (window.testRunner) {
+            if (window.testRunner)
                 testRunner.waitUntilDone();
-                testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
-            }
 
             if (window.internals) {
                 window.internals.settings.setTextAutosizingEnabled(true);
index c67f9bf..9bb3d9a 100644 (file)
@@ -1,4 +1,4 @@
-<!DOCTYPE html> <!-- webkit-test-runner [ shouldIgnoreMetaViewport=true ] -->
+<!DOCTYPE html> <!-- webkit-test-runner [ shouldIgnoreMetaViewport=true enablePageCache=true ] -->
 
 <html>
 <head>
@@ -42,7 +42,6 @@
     // Force a back navigation back to this page.
     window.addEventListener("load", function(event) {
         setTimeout(function() {
-            window.testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
             window.location.href = "resources/go-back.html";
         }, 0);
     }, false);    
index 1e86afb..3feb00d 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <html>
     <head>
         <title>Viewport meta data stored in page cache.</title>
@@ -9,7 +10,6 @@
             if (window.testRunner) {
                 testRunner.dumpAsText();
                 testRunner.waitUntilDone();
-                testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
             }
 
             function pageshow(evt)
index 08d703d..ff5815e 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <html>
 <head>
 <script>
@@ -10,7 +11,6 @@ function runTest()
         testRunner.dumpAsText();
         testRunner.waitUntilDone();
         testRunner.setCanOpenWindows();
-        testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
 
         document.getElementById('result').innerHTML = 'FAILURE: image1.html not loaded';
         window.open("resources/image1.html", "_blank");
index a268402..d8dd2fb 100644 (file)
@@ -19,8 +19,6 @@ http://127.0.0.1:8000/loading/main-resource-delegates-on-back-navigation.html -
 http://127.0.0.1:8000/loading/main-resource-delegates-on-back-navigation.html - didReceiveResponse <NSURLResponse http://127.0.0.1:8000/loading/main-resource-delegates-on-back-navigation.html, http status code 200>
 main frame - didCommitLoadForFrame
 http://127.0.0.1:8000/loading/main-resource-delegates-on-back-navigation.html - didFinishLoading
-main frame - didFinishDocumentLoadForFrame
-main frame - didHandleOnloadEventsForFrame
 main frame - didFinishLoadForFrame
 main frame - willPerformClientRedirectToURL: http://127.0.0.1:8000/loading/resources/page-go-back-onload.html 
 main frame - didStartProvisionalLoadForFrame
index 0b3e85b..0494875 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <body>
@@ -30,9 +31,6 @@ window.addEventListener('pageshow', function() {
         break;
     }
 
-    if (window.testRunner)
-        testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", pageCacheEnabled);
-
     setTimeout(function() {
         window.location.href = "resources/page-go-back-onload.html";
     }, 0);
index 061969a..ca5788e 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <script>
 
 window.onpageshow = function(evt) {
@@ -25,7 +26,6 @@ window.onload = function(evt) {
 }
 
 if (window.testRunner) {
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
     testRunner.dumpAsText();
     testRunner.waitUntilDone();
 } else
index c95954a..f2ac66a 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <script>
 
 window.onpageshow = function(evt) {
@@ -25,7 +26,6 @@ window.onload = function(evt) {
 }
 
 if (window.testRunner) {
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
     testRunner.dumpAsText();
     testRunner.waitUntilDone();
 } else
index fc0b506..3fe6800 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
     <head>
@@ -9,7 +10,6 @@
             if (window.testRunner) {
                 testRunner.dumpAsText();
                 testRunner.waitUntilDone();
-                testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
             }
 
             function logEvent(event) 
index cd61fb8..18bd139 100644 (file)
@@ -1,6 +1,6 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <script>
 if (window.testRunner) {
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
     testRunner.dumpAsText();
     testRunner.queueLoadHTMLString("<script>document.write('<div id=result>FAIL: The alternate HTML string was cached, but should not have been cached for an error page</div>');<\/script>", "resources", "http://127.0.0.1:8000/navigation/resources/page-treated-as-unreachable.html");
     testRunner.queueLoad("resources/page-to-go-back-from.html");
index 34b9f6e..eee9b26 100644 (file)
@@ -1,9 +1,9 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <script>
 
 if (window.testRunner) {
     testRunner.dumpAsText();
     testRunner.waitUntilDone();
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
 }
 
 if (location.protocol != "https:")
index 8abe211..f098f14 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <html><head>
 <title>Image load in pagehide handler</title>
 <script>
@@ -8,7 +9,6 @@ function test() {
     if (!testCalled) {
         if (window.testRunner) {
             testRunner.dumpAsText();
-            testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
             testRunner.waitUntilDone();
         }
         testCalled = true;
index fa0176f..0267e5d 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <head>
@@ -7,7 +8,6 @@ description("A cached page with a URL fragment shouldn't send the fragment in th
 
 if (window.testRunner) {
     testRunner.clearBackForwardList();
-    testRunner.overridePreference('WebKitUsesPageCachePreferenceKey', 1);
     testRunner.dumpAsText();
 
     testRunner.queueLoad('resources/success.html');
index aa0bf4d..bc88764 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <body>
@@ -6,9 +7,6 @@
 description("A frame without current history item should not prevent page caching.");
 window.jsTestIsAsync = true;
 
-if (window.testRunner)
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
-
 window.addEventListener("pageshow", function(event) {
     debug("pageshow - " + (event.persisted ? "" : "not ") + "from cache");
 
index 4e3d2e0..038f08a 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <body>
@@ -9,8 +10,6 @@ window.jsTestIsAsync = true;
 if (window.testRunner) {
     if (testRunner.setShouldDecideNavigationPolicyAfterDelay)
           testRunner.setShouldDecideNavigationPolicyAfterDelay(true);
-
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
 }
 
 window.addEventListener("pageshow", function(event) {
index 9eb6a12..01f63bd 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <body>
@@ -6,9 +7,6 @@
 description("A frame in provisional load stage should prevent page caching.");
 window.jsTestIsAsync = true;
 
-if (window.testRunner)
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
-
 window.addEventListener("pageshow", function(event) {
     debug("pageshow - " + (event.persisted ? "" : "not ") + "from cache");
 
index b183a1c..480b1cb 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <body>
@@ -7,9 +8,6 @@ description('Tests that a page with a loading image goes into the page cache (wi
 window.jsTestIsAsync = true;
 internals.settings.setStorageBlockingPolicy('BlockThirdParty');
 
-if (window.testRunner)
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
-
 window.addEventListener("pageshow", function(event) {
     debug("pageshow - " + (event.persisted ? "" : "not ") + "from cache");
 
index 520b526..457e217 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <body>
@@ -6,9 +7,6 @@
 description('Tests that a page with a loading image goes into the page cache.');
 window.jsTestIsAsync = true;
 
-if (window.testRunner)
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
-
 window.addEventListener("pageshow", function(event) {
     debug("pageshow - " + (event.persisted ? "" : "not ") + "from cache");
 
index b738538..13b0f92 100644 (file)
@@ -6,9 +6,6 @@
 description('Tests that a page with pending ping loads can enter PageCache.');
 window.jsTestIsAsync = true;
 
-if (window.testRunner)
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
-
 let afterPageCacheRestore = false;
 
 window.addEventListener("pageshow", function(event) {
index 6832b1e..057fc89 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <body>
@@ -6,9 +7,6 @@
 description('Tests that a page with pending ping loads can enter PageCache.');
 window.jsTestIsAsync = true;
 
-if (window.testRunner)
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
-
 let afterPageCacheRestore = false;
 
 window.addEventListener("pageshow", function(event) {
index 01bfa80..5cb41c6 100644 (file)
@@ -1,4 +1,4 @@
-CONSOLE MESSAGE: line 35: XMLHttpRequest cannot load http://127.0.0.1:8000/resources/load-and-stall.cgi?name=load-and-stall.cgi&stallFor=3&stallAt=0&mimeType=text/plain due to access control checks.
+CONSOLE MESSAGE: line 33: XMLHttpRequest cannot load http://127.0.0.1:8000/resources/load-and-stall.cgi?name=load-and-stall.cgi&stallFor=3&stallAt=0&mimeType=text/plain due to access control checks.
 Tests that a page with a loading XMLHttpRequest goes into the page cache.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
index 7c0bb44..0b11301 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <body>
@@ -8,9 +9,6 @@ window.jsTestIsAsync = true;
 
 var restoredFromPageCache = false;
 
-if (window.testRunner)
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
-
 window.addEventListener("pageshow", function(event) {
     debug("pageshow - " + (event.persisted ? "" : "not ") + "from cache");
 
index 4adcb36..522d787 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <body>
@@ -8,9 +9,6 @@ window.jsTestIsAsync = true;
 
 var restoredFromPageCache = false;
 
-if (window.testRunner)
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
-
 window.addEventListener("pageshow", function(event) {
     debug("pageshow - " + (event.persisted ? "" : "not ") + "from cache");
 
index 0b19501..c65de95 100644 (file)
@@ -3,9 +3,6 @@ header("cache-control: no-store");
 ?>
 <script>
 
-if (window.testRunner)
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
-
 function nextTest() {
        if (window.sessionStorage.https_in_page_cache_started)
                delete window.sessionStorage.https_in_page_cache_started;
@@ -32,4 +29,4 @@ window.onload = function() {
 
 }
 
-</script>
\ No newline at end of file
+</script>
index 453164a..1417e4c 100644 (file)
@@ -1,11 +1,8 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <?php
 header("cache-control: no-cache");
 ?>
 <script>
-
-if (window.testRunner)
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
-
 function nextTest() {
        if (window.sessionStorage.https_in_page_cache_started)
                delete window.sessionStorage.https_in_page_cache_started;
index e6305a9..7dfff28 100644 (file)
@@ -1,7 +1,5 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <script>
-if (window.testRunner)
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
-
 window.onpageshow = function(evt) {
        if (!evt.persisted)
                return;
@@ -17,4 +15,4 @@ window.onload = function() {
        setTimeout('window.location = "go-back.html"', 0);
 }
 
-</script>
\ No newline at end of file
+</script>
index cc14d67..636d118 100644 (file)
@@ -13,9 +13,6 @@ window.onpageshow = function(evt)
 
 window.onload = function()
 {
-    if (window.testRunner)
-        testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
-
     if (window.sessionStorage.https_in_page_cache_started) {
         alert("FAIL: The page was reloaded on back. It should NOT have been.");
         if (window.testRunner)
index 436df06..a344e26 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <body onload="runTest()">
@@ -7,9 +8,6 @@ description("Tests that we don't crash when a load is started in a subframe on '
 window.jsTestIsAsync = true;
 var totalLoaded = 0;
 
-if (window.testRunner)
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
-
 window.addEventListener("pageshow", function(event) {
     debug("pageshow - " + (event.persisted ? "" : "not ") + "from cache");
 
index 9fd5dc5..c3c3755 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <body onload="runTest()">
@@ -7,9 +8,6 @@ description("Tests that we don't crash when a load is started in a subframe on '
 window.jsTestIsAsync = true;
 var totalLoaded = 0;
 
-if (window.testRunner)
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
-
 window.addEventListener("pageshow", function(event) {
     debug("pageshow - " + (event.persisted ? "" : "not ") + "from cache");
 
index 14d93c6..1164b75 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <body>
@@ -7,10 +8,8 @@
 description("Tests that inserting a script into newly opened window does not bypass origin checks.");
 debug("This test passes unless you see FAIL messages below");
 jsTestIsAsync = true;
-if (window.testRunner) {
+if (window.testRunner)
     testRunner.setCanOpenWindows();
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
-}
 
 window.onload = function() {
     let win = open("about:blank", "one");
index 23221ab..266ba9c 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <body>
@@ -7,10 +8,8 @@
 description("Tests that inserting a script into newly opened window does not bypass origin checks.");
 debug("This test passes unless you see FAIL messages below");
 jsTestIsAsync = true;
-if (window.testRunner) {
+if (window.testRunner)
     testRunner.setCanOpenWindows();
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
-}
 
 window.onload = function() {
     let win = open("about:blank", "one");
index 9686659..9051db8 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <body>
@@ -6,7 +7,6 @@
 if (window.testRunner) {
   testRunner.dumpAsText();
   testRunner.waitUntilDone();
-  testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
   testRunner.setCanOpenWindows();
 }
 
index 037430a..13314e6 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <head>
@@ -7,7 +8,6 @@ if (window.testRunner) {
     testRunner.setCanOpenWindows();
     testRunner.setPopupBlockingEnabled(false);
     testRunner.setCloseRemainingWindowsWhenComplete(true);
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
     testRunner.waitUntilDone();
 }
 </script>
index e4be4c1..2961976 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <body>
@@ -8,7 +9,6 @@ if (window.testRunner) {
     testRunner.setCanOpenWindows();
     testRunner.setPopupBlockingEnabled(false);
     testRunner.setCloseRemainingWindowsWhenComplete(true);
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
     testRunner.waitUntilDone();
 }
 
index 481762a..6a3bd18 100644 (file)
@@ -1,4 +1,4 @@
-<!DOCTYPE html><!-- webkit-test-runner [ enableProcessSwapOnNavigation=true ] -->
+<!DOCTYPE html><!-- webkit-test-runner [ enableProcessSwapOnNavigation=true enablePageCache=true ] -->
 <html>
 <head>
 <script>
@@ -7,7 +7,6 @@ if (window.testRunner) {
     testRunner.setCanOpenWindows();
     testRunner.setPopupBlockingEnabled(false);
     testRunner.setCloseRemainingWindowsWhenComplete(true);
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
     testRunner.waitUntilDone();
 }
 </script>
index e9b75df..84bc5be 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <head>
@@ -7,7 +8,6 @@ if (window.testRunner) {
     testRunner.setCanOpenWindows();
     testRunner.setPopupBlockingEnabled(false);
     testRunner.setCloseRemainingWindowsWhenComplete(true);
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
     testRunner.waitUntilDone();
 }
 </script>
index af2838b..8d6bf2c 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <head>
@@ -7,7 +8,6 @@ if (window.testRunner) {
     testRunner.setCanOpenWindows();
     testRunner.setPopupBlockingEnabled(false);
     testRunner.setCloseRemainingWindowsWhenComplete(true);
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
     testRunner.waitUntilDone();
 }
 </script>
index 3b38df0..4e7143b 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <body>
@@ -6,8 +7,6 @@
 description("Test that an open WebSocket does not prevent a page from entering page cache.");
 
 window.jsTestIsAsync = true;
-if (window.testRunner)
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
 
 var wasRestoredFromPageCache = false;
 var receivedErrorEvent = false;
index 7f338cc..4ac20c0 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <body>
@@ -8,8 +9,6 @@ description("Tests that WebSocket correctly handles being stopped in the error e
 var wasRestoredFromPageCache = false;
 
 window.jsTestIsAsync = true;
-if (window.testRunner)
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
 
 window.addEventListener("pageshow", function(event) {
     debug("pageshow - " + (event.persisted ? "" : "not ") + "from cache");
index 62bd629..5bb0bee 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <body>
@@ -6,10 +7,8 @@
 log("* Tests that a client is re-added to the list of service worker clients when it is restored from the page cache");
 log("");
 
-if (window.testRunner) {
+if (window.testRunner)
   testRunner.setCanOpenWindows();
-  testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
-}
 
 let tries = 0;
 
index b10919a..bec11ea 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <body>
@@ -6,10 +7,8 @@
 log("* Tests that a client is removed from the list of service worker clients while it is in the page cache");
 log("");
 
-if (window.testRunner) {
+if (window.testRunner)
   testRunner.setCanOpenWindows();
-  testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
-}
 
 let topClientIdentifier = null;
 let windowClientIdentifier = null;
index ba13176..cbe1950 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <head>
@@ -6,9 +7,6 @@
 <script>
 const RESOURCES_DIR = "/beacon/resources/";
 var id = self.token();
-
-if (window.testRunner)
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
 </script>
 </head>
 <body>
index d0e79d8..ded3875 100644 (file)
@@ -1,4 +1,4 @@
-<!-- webkit-test-runner [ experimental:WebAnimationsCSSIntegrationEnabled=false ] -->
+<!-- webkit-test-runner [ experimental:WebAnimationsCSSIntegrationEnabled=false enablePageCache=true ] -->
 <style>
 @-webkit-keyframes bounce {
     from {
@@ -26,7 +26,6 @@ var hasNavigated = false;
 function sawIteration(event) {
     if (hasNavigated) {
         document.getElementById("results").innerText = "PASS: Saw iteration after navigation";
-        window.testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 0);
         testRunner.notifyDone();
     }
 }
@@ -43,7 +42,6 @@ function startTest() {
 if (window.testRunner) {
     window.testRunner.dumpAsText();
     window.testRunner.waitUntilDone();
-    window.testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
 }
 
 window.addEventListener("load", startTest, false);
index 753d5b0..984f640 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <html>
 <head>
     <title>Test resource load callbacks going back to a cached main resource</title>
@@ -7,7 +8,6 @@
         testRunner.dumpResourceLoadCallbacks();
         testRunner.setCanOpenWindows();
         testRunner.waitUntilDone();
-        testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
     }
 
     // Window we will be controlling.
index 8ac3ab3..5843e7f 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <html>
 <script>
 
@@ -29,7 +30,6 @@ function runTestStep() {
     if (window.testRunner) {
       testRunner.dumpAsText();
       testRunner.waitUntilDone();
-      testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
     }
     window.resizeTo(300, 300);
     // Wait a bit before navigating away to make sure we have done layout due to the resizing.
index 894c874..819591e 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <script>
 var childWindow;
 </script>
@@ -12,7 +13,6 @@ If it doesn't crash, it passes.<br>
 if (window.testRunner && window.internals) {
     testRunner.dumpAsText();
     testRunner.waitUntilDone();
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
     internals.settings.setPageCacheSupportsPlugins(true);
     testRunner.setCanOpenWindows(true);
     testRunner.setCloseRemainingWindowsWhenComplete(true);
index 5c1454c..e950518 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <html>
     <head>
         <script src=media-file.js></script>
@@ -9,7 +10,6 @@
             if (window.testRunner) {
                 testRunner.dumpAsText();
                 testRunner.waitUntilDone();
-                testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
             }
 
             function pageshow(evt) 
index 7a778f9..d064043 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <head>
@@ -35,9 +36,6 @@ function onPageHide()
 
 function onPageLoad()
 {
-    if (window.testRunner)
-      testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
-
     // Navigate in a timeout to make sure we create a history entry.
     setTimeout(function() {
       window.location.href = 'resources/jump-back.html';
index 29eccf8..6f884f3 100644 (file)
@@ -1,9 +1,9 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <head>
 <script>
 if (window.testRunner && window.internals) {
     testRunner.dumpAsText();
     testRunner.waitUntilDone();
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
     internals.settings.setPageCacheSupportsPlugins(true);
 }
 
index 4bb532f..ca85bdc 100644 (file)
@@ -1,10 +1,10 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <html>
 <script type="text/javascript" charset="utf-8">
     if (window.testRunner && window.internals) {
         testRunner.dumpAsText();
         testRunner.waitUntilDone();
         internals.settings.setFrameFlattening("FullyEnabled")
-        testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
         internals.settings.setPageCacheSupportsPlugins(true);
     }
 </script>
index e1666af..4f82341 100644 (file)
@@ -1,9 +1,9 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <html>
 <script>
 if (window.testRunner && window.internals) {
     testRunner.dumpAsText();
     testRunner.waitUntilDone();
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
     internals.settings.setPageCacheSupportsPlugins(true);
 }
 
index 871a2bc..6565b07 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <head>
 <style>
 html {
@@ -58,7 +59,6 @@ window.onload = function () {
         testRunner.installDidEndSwipeCallback(didEndSwipeCallback);
         testRunner.installDidRemoveSwipeSnapshotCallback(didRemoveSwipeSnapshotCallback);
 
-        testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
         testRunner.dumpAsText();
         testRunner.waitUntilDone();
 
@@ -73,4 +73,4 @@ window.onload = function () {
 </script>
 </head>
 <body>
-</body>
\ No newline at end of file
+</body>
index a369b82..c81f3e6 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <head>
 <style>
 html {
@@ -81,7 +82,6 @@ window.onload = function () {
         testRunner.installDidEndSwipeCallback(didEndSwipeCallback);
         testRunner.installDidRemoveSwipeSnapshotCallback(didRemoveSwipeSnapshotCallback);
 
-        testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
         testRunner.dumpAsText();
         testRunner.waitUntilDone();
 
@@ -100,4 +100,4 @@ window.onload = function () {
 </head>
 <body>
 <div id="large" style="width: 2000px; height: 2000px;"></div>
-</body>
\ No newline at end of file
+</body>
index 9a8dc9d..a0119f1 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <head>
 <style>
 html {
@@ -63,7 +64,6 @@ window.onload = function () {
     testRunner.installDidEndSwipeCallback(didEndSwipeCallback);
     testRunner.installDidRemoveSwipeSnapshotCallback(didRemoveSwipeSnapshotCallback);
 
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
     testRunner.dumpAsText();
     testRunner.waitUntilDone();
 
@@ -83,4 +83,4 @@ window.onload = function () {
 </script>
 </head>
 <body>
-</body>
\ No newline at end of file
+</body>
index 3f87a03..02fd44e 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <head>
 <style>
 html {
@@ -96,7 +97,6 @@ window.onload = function () {
 
     testRunner.installDidBeginSwipeCallback(didBeginSwipeCallback);
 
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
     testRunner.dumpAsText();
     testRunner.waitUntilDone();
 
@@ -116,4 +116,4 @@ window.onload = function () {
 </script>
 </head>
 <body>
-</body>
\ No newline at end of file
+</body>
index 3ef28a9..1f1d7ae 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <head>
 <style>
 html {
@@ -43,7 +44,6 @@ window.onload = function () {
     testRunner.installDidEndSwipeCallback(didEndSwipeCallback);
     testRunner.installDidRemoveSwipeSnapshotCallback(didRemoveSwipeSnapshotCallback);
 
-    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
     testRunner.dumpAsText();
     testRunner.waitUntilDone();
 
@@ -57,4 +57,4 @@ window.onload = function () {
 </head>
 <body>
 first
-</body>
\ No newline at end of file
+</body>
index d64ef6b..77c3c0a 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <head>
@@ -13,7 +14,6 @@
         if (window.testRunner) {
             testRunner.dumpAsText();
             testRunner.waitUntilDone();
-            testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
         }
 
         function pageHidden()
index 6a2851f..bdd0875 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
 <!DOCTYPE html>
 <html>
 <head>
@@ -6,7 +7,6 @@
             testRunner.dumpAsText();
             testRunner.waitUntilDone();
             testRunner.setCanOpenWindows();
-            testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
         }
 
         window.finishedTest = function (layerTree)
index 161ddcc..2cd7874 100644 (file)
@@ -1,3 +1,13 @@
+2019-09-26  Chris Dumez  <cdumez@apple.com>
+
+        Stop using testRunner.overridePreference() to turn on Page Cache
+        https://bugs.webkit.org/show_bug.cgi?id=202274
+
+        Reviewed by Alex Christensen.
+
+        * WebProcess/InjectedBundle/InjectedBundle.cpp:
+        (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
+
 2019-09-26  Andy Estes  <aestes@apple.com>
 
         Crash under WebPage::beginPrinting when m_printContext becomes null due to synchronous layout
index b95db89..691f1aa 100644 (file)
@@ -270,7 +270,6 @@ void InjectedBundle::overrideBoolPreferenceForTestRunner(WebPageGroupProxy* page
     macro(WebKitJavaEnabled, JavaEnabled, javaEnabled) \
     macro(WebKitJavaScriptEnabled, ScriptEnabled, javaScriptEnabled) \
     macro(WebKitPluginsEnabled, PluginsEnabled, pluginsEnabled) \
-    macro(WebKitUsesPageCachePreferenceKey, UsesPageCache, usesPageCache) \
     macro(WebKitWebAudioEnabled, WebAudioEnabled, webAudioEnabled) \
     macro(WebKitWebGLEnabled, WebGLEnabled, webGLEnabled) \
     macro(WebKitXSSAuditorEnabled, XSSAuditorEnabled, xssAuditorEnabled) \
index 3e52d16..2c24fea 100644 (file)
@@ -1,3 +1,15 @@
+2019-09-26  Chris Dumez  <cdumez@apple.com>
+
+        Stop using testRunner.overridePreference() to turn on Page Cache
+        https://bugs.webkit.org/show_bug.cgi?id=202274
+
+        Reviewed by Alex Christensen.
+
+        * DumpRenderTree/TestRunner.cpp:
+        (overridePreferenceCallback):
+        * WebKitTestRunner/InjectedBundle/TestRunner.cpp:
+        (WTR::TestRunner::overridePreference):
+
 2019-09-26  Jonathan Bedard  <jbedard@apple.com>
 
         results.webkit.org: Use cursor: pointer for clickable elements
index 8fb9393..147eb31 100644 (file)
@@ -583,6 +583,9 @@ static JSValueRef overridePreferenceCallback(JSContextRef context, JSObjectRef f
     auto value = adopt(JSValueToStringCopy(context, arguments[1], exception));
     ASSERT(!*exception);
 
+    // Should use `<!-- webkit-test-runner [ enablePageCache=true ] -->` instead.
+    RELEASE_ASSERT(!JSStringIsEqualToUTF8CString(key.get(), "WebKitUsesPageCachePreferenceKey"));
+
     TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
     controller->overridePreference(key.get(), value.get());
 
index f816242..cff40f3 100644 (file)
@@ -857,6 +857,9 @@ static inline bool toBool(JSStringRef value)
 void TestRunner::overridePreference(JSStringRef preference, JSStringRef value)
 {
     auto& injectedBundle = InjectedBundle::singleton();
+    // Should use `<!-- webkit-test-runner [ enablePageCache=true ] -->` instead.
+    RELEASE_ASSERT(!JSStringIsEqualToUTF8CString(preference, "WebKitUsesPageCachePreferenceKey"));
+
     // FIXME: handle non-boolean preferences.
     WKBundleOverrideBoolPreferenceForTestRunner(injectedBundle.bundle(), injectedBundle.pageGroup(), toWK(preference).get(), toBool(value));
 }