Commit b581ef6f authored by cfleizach@apple.com's avatar cfleizach@apple.com

AX: layout tests need to be updated to reflect what is being tested

https://bugs.webkit.org/show_bug.cgi?id=38556

Reviewed by Beth Dakin.

Many of the initial AX layout tests just dumped a lot of attributes and did not
have a focused test. This updates some of those tests (more to follow in the future).

* accessibility/image-map1.html:
* accessibility/img-aria-button-alt-tag-expected.txt:
* accessibility/img-aria-button-alt-tag.html:
* accessibility/input-image-alt-expected.txt:
* accessibility/input-image-alt.html:
* accessibility/placeholder-expected.txt:
* accessibility/placeholder.html:
* platform/mac/accessibility/image-map1-expected.txt:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@58794 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent a2ccb1f3
2010-05-04 Chris Fleizach <cfleizach@apple.com>
Reviewed by Beth Dakin.
AX: layout tests need to be updated to reflect what is being tested
https://bugs.webkit.org/show_bug.cgi?id=38556
Many of the initial AX layout tests just dumped a lot of attributes and did not
have a focused test. This updates some of those tests (more to follow in the future).
* accessibility/image-map1.html:
* accessibility/img-aria-button-alt-tag-expected.txt:
* accessibility/img-aria-button-alt-tag.html:
* accessibility/input-image-alt-expected.txt:
* accessibility/input-image-alt.html:
* accessibility/placeholder-expected.txt:
* accessibility/placeholder.html:
* platform/mac/accessibility/image-map1-expected.txt:
2010-05-04 Dirk Pranke <dpranke@chromium.org>
Unreviewed, expectations change.
......
<html>
<head>
<link rel="stylesheet" href="../fast/js/resources/js-test-style.css">
<script>
var successfullyParsed = false;
</script>
<script src="../fast/js/resources/js-test-pre.js"></script>
</head>
<script>
if (window.layoutTestController)
layoutTestController.dumpAsText();
</script>
<body id="body">
<div id="result"></div>
<!-- Test image map -->
<map id="apple" name="imagemap1">
<area shape="rect" coords="10,10,133,72" href="http://www.apple.com" title="Link1" />
......@@ -17,17 +22,28 @@
<img src="resources/cake.png" border="0" align="left" usemap="#imagemap1" vspace="1">
<p id="description"></p>
<div id="console"></div>
<script>
description("This tests that you can reach the links within an image map.");
if (window.accessibilityController) {
var result = document.getElementById("result");
document.getElementById("body").focus();
var body = document.getElementById("body");
body.focus();
result.innerText += "Image map - test 1 - 3 Links\n";
result.innerText += "----------------------\n";
result.innerText += accessibilityController.focusedElement.attributesOfChildren() + "\n\n";
var body = accessibilityController.focusedElement;
shouldBe("body.childAtIndex(0).role", "'AXRole: AXLink'");
shouldBe("body.childAtIndex(0).title", "'AXTitle: Link1'");
shouldBe("body.childAtIndex(1).role", "'AXRole: AXLink'");
shouldBe("body.childAtIndex(1).title", "'AXTitle: Link2'");
shouldBe("body.childAtIndex(2).role", "'AXRole: AXLink'");
shouldBe("body.childAtIndex(2).title", "'AXTitle: Link3'");
}
</script>
successfullyParsed = true;
</script>
<script src="../fast/js/resources/js-test-post.js"></script>
</body>
</html>
Test passed
This test makes sure that a img acting as an aria button still returns its alt tag as the description
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS imgUIElement.description is 'AXDescription: alternate'
PASS successfullyParsed is true
TEST COMPLETE
<html>
<head>
<link rel="stylesheet" href="../fast/js/resources/js-test-style.css">
<script>
var successfullyParsed = false;
</script>
<script src="../fast/js/resources/js-test-pre.js"></script>
</head>
<script>
if (window.layoutTestController)
layoutTestController.dumpAsText();
</script>
<body id="body">
<!-- This test makes sure that a img acting as an aria button still returns its alt tag as the description -->
<img id='image' src="resources/cake.png" role="button" alt="alternate" title="title">
<div id="result"></div>
<p id="description"></p>
<div id="console"></div>
<script>
description("This test makes sure that a img acting as an aria button still returns its alt tag as the description");
if (window.accessibilityController) {
var result = document.getElementById("result");
var body = document.getElementById("body");
body.focus();
var body = document.getElementById("body").focus();
var imgUIElement = accessibilityController.focusedElement.childAtIndex(0).childAtIndex(0);
var pattern = "AXDescription: alternate";
if (imgUIElement.allAttributes().indexOf(pattern) != -1) {
result.innerText += "Test passed\n";
}
else {
result.innerText += "Test failed\n";
}
shouldBe("imgUIElement.description", "'AXDescription: alternate'");
}
successfullyParsed = true;
</script>
<script src="../fast/js/resources/js-test-post.js"></script>
</body>
</html>
Test passed
This test makes sure that an input image returns its alt tag as the description
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS img.description is 'AXDescription: Submit'
PASS successfullyParsed is true
TEST COMPLETE
<html>
<html>
<head>
<link rel="stylesheet" href="../fast/js/resources/js-test-style.css">
<script>
if (window.layoutTestController)
layoutTestController.dumpAsText();
var successfullyParsed = false;
</script>
<script src="../fast/js/resources/js-test-pre.js"></script>
</head>
<body id="body">
<!-- This test makes sure that an input image returns its alt tag as the description -->
<input type="image" alt="Submit" src="resources/cake.png" width=100 height=100 id="image1">
<div id="result"></div>
<p id="description"></p>
<div id="console"></div>
<script>
if (window.accessibilityController) {
var result = document.getElementById("result");
description("This test makes sure that an input image returns its alt tag as the description");
var image1 = document.getElementById("image1");
image1.focus();
var image1 = document.getElementById("image1").focus();
var img = accessibilityController.focusedElement;
var pattern = "Description: Submit";
if (img.allAttributes().indexOf(pattern) != -1) {
result.innerText += "Test passed\n";
}
else {
result.innerText += "Test failed\n";
}
shouldBe("img.description", "'AXDescription: Submit'");
}
successfullyParsed = true;
</script>
</body>
<script src="../fast/js/resources/js-test-post.js"></script>
</body>
</html>
Test passed
This test makes sure that the AXTitle will fall back to placeholder text if nothing else is available
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS fieldElement.title is 'AXTitle: search'
PASS successfullyParsed is true
TEST COMPLETE
<html>
<html>
<head>
<link rel="stylesheet" href="../fast/js/resources/js-test-style.css">
<script>
if (window.layoutTestController)
layoutTestController.dumpAsText();
var successfullyParsed = false;
</script>
<script src="../fast/js/resources/js-test-pre.js"></script>
</head>
<body id="body">
<!-- This test makes sure that the AXTitle will fall back to placeholder text if nothing else is available -->
<input placeholder="search" type="text" name="q" size="15" maxlength="255" id="searchterm" />
<div id="result"></div>
<p id="description"></p>
<div id="console"></div>
<script>
if (window.accessibilityController) {
var result = document.getElementById("result");
description("This test makes sure that the AXTitle will fall back to placeholder text if nothing else is available");
var field = document.getElementById("searchterm");
field.focus();
var field = document.getElementById("searchterm").focus();
var fieldElement = accessibilityController.focusedElement;
var pattern = "AXTitle: search";
if (fieldElement.allAttributes().indexOf(pattern) != -1) {
result.innerText += "Test passed\n";
}
else {
result.innerText += "Test failed\n";
}
shouldBe("fieldElement.title", "'AXTitle: search'");
}
successfullyParsed = true;
</script>
<script src="../fast/js/resources/js-test-post.js"></script>
</body>
</html>
Image map - test 1 - 3 Links
----------------------
AXRole: AXGroup
AXSubrole: (null)
AXRoleDescription: group
AXChildren: <array of size 2>
AXHelp:
AXParent: <AXGroup>
AXSize: NSSize: {784, 36}
AXTitle:
AXDescription:
AXValue:
AXFocused: 0
AXEnabled: 1
AXWindow: <AXGroup>
AXSelectedTextMarkerRange: (null)
AXStartTextMarker: <AXGroup>
AXEndTextMarker: <AXGroup>
AXVisited: 0
AXLinkedUIElements: (null)
AXSelected: 0
AXBlockQuoteLevel: 0
AXTopLevelUIElement: <AXGroup>
AXTitleUIElement: (null)
------------
AXRole: AXLink
AXSubrole: (null)
AXRoleDescription: link
AXChildren: <array of size 0>
AXHelp:
AXParent: <AXLink: 'Link1'>
AXSize: NSSize: {123, 62}
AXTitle: Link1
AXDescription:
AXValue:
AXFocused: 0
AXEnabled: 1
AXWindow: <AXLink: 'Link1'>
AXSelectedTextMarkerRange: (null)
AXStartTextMarker: (null)
AXEndTextMarker: (null)
AXVisited: 0
AXLinkedUIElements: (null)
AXSelected: 0
AXBlockQuoteLevel: 0
AXTopLevelUIElement: <AXLink: 'Link1'>
AXURL: http://www.apple.com/
AXAccessKey: (null)
This tests that you can reach the links within an image map.
------------
AXRole: AXLink
AXSubrole: (null)
AXRoleDescription: link
AXChildren: <array of size 0>
AXHelp:
AXParent: <AXLink: 'Link2'>
AXSize: NSSize: {122, 14}
AXTitle: Link2
AXDescription:
AXValue:
AXFocused: 0
AXEnabled: 1
AXWindow: <AXLink: 'Link2'>
AXSelectedTextMarkerRange: (null)
AXStartTextMarker: (null)
AXEndTextMarker: (null)
AXVisited: 0
AXLinkedUIElements: (null)
AXSelected: 0
AXBlockQuoteLevel: 0
AXTopLevelUIElement: <AXLink: 'Link2'>
AXURL: http://www.apple.com/
AXAccessKey: (null)
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
------------
AXRole: AXLink
AXSubrole: (null)
AXRoleDescription: link
AXChildren: <array of size 0>
AXHelp:
AXParent: <AXLink: 'Link3'>
AXSize: NSSize: {122, 14}
AXTitle: Link3
AXDescription:
AXValue:
AXFocused: 0
AXEnabled: 1
AXWindow: <AXLink: 'Link3'>
AXSelectedTextMarkerRange: (null)
AXStartTextMarker: (null)
AXEndTextMarker: (null)
AXVisited: 0
AXLinkedUIElements: (null)
AXSelected: 0
AXBlockQuoteLevel: 0
AXTopLevelUIElement: <AXLink: 'Link3'>
AXURL: http://www.apple.com/
AXAccessKey: (null)
------------
PASS body.childAtIndex(0).role is 'AXRole: AXLink'
PASS body.childAtIndex(0).title is 'AXTitle: Link1'
PASS body.childAtIndex(1).role is 'AXRole: AXLink'
PASS body.childAtIndex(1).title is 'AXTitle: Link2'
PASS body.childAtIndex(2).role is 'AXRole: AXLink'
PASS body.childAtIndex(2).title is 'AXTitle: Link3'
PASS successfullyParsed is true
TEST COMPLETE
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