Add new SVGDOM SVGFEBLEND constants
[WebKit-https.git] / LayoutTests / swipe / basic-cached-back-swipe.html
1 <head>
2 <style>
3 html {
4     font-size: 32pt;
5 }
6 </style>
7 <script src="resources/swipe-test.js"></script>
8 <script>
9 function didBeginSwipeCallback()
10 {
11     log("didBeginSwipe");
12
13     completeSwipeGesture();
14 }
15
16 function willEndSwipeCallback()
17 {
18     log("willEndSwipe");
19
20     shouldBe(false, isFirstPage(), "The swipe should not yet have navigated away from the second page.");
21 }
22
23 function didEndSwipeCallback()
24 {
25     log("didEndSwipe");
26
27     startMeasuringDuration("snapshotRemoval");
28 }
29
30 function didRemoveSwipeSnapshotCallback()
31 {
32     log("didRemoveSwipeSnapshot");
33     
34     shouldBe(true, isFirstPage(), "The swipe should have navigated back to the first page.");
35     measuredDurationShouldBeLessThan("snapshotRemoval", 1000, "Because we're using the page cache, it shouldn't be long between the gesture completing and the snapshot being removed.")
36
37     testComplete();
38 }
39
40 function isFirstPage()
41 {
42     return window.location.href.indexOf("second") == -1;
43 }
44
45 window.onload = function () {
46     if (!window.eventSender || !window.testRunner) {
47         document.body.innerHTML = "This test must be run in WebKitTestRunner.";
48         return;
49     }
50
51     document.body.innerHTML = isFirstPage() ? "first" : "second";
52
53     if (isFirstPage()) {
54         initializeSwipeTest();
55
56         testRunner.installDidBeginSwipeCallback(didBeginSwipeCallback);
57         testRunner.installWillEndSwipeCallback(willEndSwipeCallback);
58         testRunner.installDidEndSwipeCallback(didEndSwipeCallback);
59         testRunner.installDidRemoveSwipeSnapshotCallback(didRemoveSwipeSnapshotCallback);
60
61         testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
62         testRunner.dumpAsText();
63         testRunner.waitUntilDone();
64
65         setTimeout(function () { 
66             window.location.href = window.location.href + "?second";
67         }, 0);
68         return;
69     }
70
71     startSwipeGesture();
72 };
73 </script>
74 </head>
75 <body>
76 </body>