Commit 52560209 authored by tonikitoo@webkit.org's avatar tonikitoo@webkit.org
Browse files

2011-01-07 Antonio Gomes <agomes@rim.com>

        Reviewed by Kenneth Rohde Christiansen.

        [Qt] Spatial Navigation: adding a test for when scrollbars are turned off via WebKit API
        https://bugs.webkit.org/show_bug.cgi?id=51396

        Add a layout test to ensure that page is scrollable when spatial
        navgation is enabled even when scrollbars were disabled via WebKit
        API (e.g. QWebFrame::setScrollBarPolicy).

        Test is Qt-only for now since Qt's DRT is the only one that supports
        LayoutTestController::setScrollbarPolicy.

        In real world QtWebKit apps, scrollbars are disabled usually prior to
        any page load. To emulate that on a layout test, it was added two html
        files: one that set scrollbars off and queues the load of the real
        test, and other that does the real testing.

        * platform/qt/fast/spatial-navigation/resources/ensure-scrolls-with-scrollbars-disabled-by-webkit.html: Added.
        * platform/qt/fast/spatial-navigation/snav-ensure-scrolls-with-scrollbars-disabled-by-webkit-expected.txt: Added.
        * platform/qt/fast/spatial-navigation/snav-ensure-scrolls-with-scrollbars-disabled-by-webkit.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75321 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent b83db656
2011-01-07 Antonio Gomes <agomes@rim.com>
Reviewed by Kenneth Rohde Christiansen.
[Qt] Spatial Navigation: adding a test for when scrollbars are turned off via WebKit API
https://bugs.webkit.org/show_bug.cgi?id=51396
Add a layout test to ensure that page is scrollable when spatial
navgation is enabled even when scrollbars were disabled via WebKit
API (e.g. QWebFrame::setScrollBarPolicy).
Test is Qt-only for now since Qt's DRT is the only one that supports
LayoutTestController::setScrollbarPolicy.
In real world QtWebKit apps, scrollbars are disabled usually prior to
any page load. To emulate that on a layout test, it was added two html
files: one that set scrollbars off and queues the load of the real
test, and other that does the real testing.
* platform/qt/fast/spatial-navigation/resources/ensure-scrolls-with-scrollbars-disabled-by-webkit.html: Added.
* platform/qt/fast/spatial-navigation/snav-ensure-scrolls-with-scrollbars-disabled-by-webkit-expected.txt: Added.
* platform/qt/fast/spatial-navigation/snav-ensure-scrolls-with-scrollbars-disabled-by-webkit.html: Added.
2011-01-07 Nico Weber <thakis@chromium.org>
 
Unreviewed, test expectations.
......
<html>
<head>
<script src="../../../../../fast/js/resources/js-test-pre.js"></script>
<script src="../../../../../fast/spatial-navigation/resources/spatial-navigation-utils.js"></script>
<script type="application/javascript">
var resultMap = [
["Down", "start"],
["DONE", "DONE"]
];
if (window.layoutTestController) {
layoutTestController.dumpAsText();
layoutTestController.setSpatialNavigationEnabled(true);
layoutTestController.overridePreference("WebKitTabToLinksPreferenceKey", 1);
layoutTestController.waitUntilDone();
}
function runTest()
{
// starting the test itself: get to a known place.
document.getElementById("start").focus();
shouldBeTrue(String(document.body.scrollTop == 0));
initTest(resultMap, testCompleted);
}
function testCompleted()
{
shouldBeTrue(String(document.body.scrollTop != 0));
if (window.layoutTestController)
layoutTestController.notifyDone();
}
window.onload = runTest;
</script>
<script src="js/resources/js-test-post.js"></script>
</head>
<body id="some-content" xmlns="http://www.w3.org/1999/xhtml">
<a id="start" href="a">Start</a>
<div style='margin-top:5000px'>
<a id="end" href="a">End</a>
</div>
<div id="console"></div>
</body>
</html>
Start
End
PASS true is true
PASS gFocusedDocument.activeElement.getAttribute("id") is "start"
PASS true is true
<html>
<!--
This test ensures the correctness the following Spatial Navigation
algorithm features.
1) When scrollbars are disabled via WebKit API, spatial navigation is still
to scroll the page towards the closest element.
* Pre-conditions:
1) DRT support for SNav enable/disable.
2) Scrollbar creations are disable by an WebKit-like API.
* Navigation steps:
1) Loads this page, focus goes to "start" automatically.
2) Attempt to move focus down to "end". As it is far enough to be outside
the viewport, a scroll action has to be performed towards "end" direction
(i.e. scroll down).
-->
<head>
<script type="application/javascript">
if (window.layoutTestController) {
layoutTestController.setScrollbarPolicy('vertical', 'off');
layoutTestController.setScrollbarPolicy('horizontal', 'off');
}
function queueit()
{
layoutTestController.queueLoad("./resources/ensure-scrolls-with-scrollbars-disabled-by-webkit.html");
}
window.onload = queueit;
</script>
</head>
<body id="some-content" xmlns="http://www.w3.org/1999/xhtml">
</body>
</html>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment