blob: 83ee905141e779c307bc5d1a2e6cdfb68e941b86 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
<script>
var successfullyParsed = false;
</script>
</head>
<body id="body">
<div role="group" id="group">
non landmark
</div>
<div role="main" id="main">
text
</div>
<div role="banner" id="banner">
text
</div>
<div role="region" id="region" aria-label="testregion">
text
</div>
<footer id="footer">
footer
</footer>
<div role="article" id="article">
article
</div>
<div role="document" id="documentcontainer">
document
</div>
<div role="note" id="note">
note
</div>
<p id="description"></p>
<div id="console"></div>
<script>
description("This tests that landmarks return their type as part of the AX label.");
if (window.accessibilityController) {
// The traits of an object inside a landmark will be different from those not in a landmark,
// so we can use that to determine if an object is marked as a landmark.
var nonLandmarkText = accessibilityController.accessibleElementById("group").childAtIndex(0);
var main = accessibilityController.accessibleElementById("main");
shouldBe("main.description", "'AXLabel: main'");
shouldBeTrue("main.childAtIndex(0).traits != nonLandmarkText.traits");
var banner = accessibilityController.accessibleElementById("banner");
shouldBe("banner.description", "'AXLabel: banner'");
shouldBeTrue("banner.childAtIndex(0).traits != nonLandmarkText.traits");
var region = accessibilityController.accessibleElementById("region");
shouldBe("region.description", "'AXLabel: testregion, region'");
shouldBeTrue("region.childAtIndex(0).traits != nonLandmarkText.traits");
var footer = accessibilityController.accessibleElementById("footer");
shouldBe("footer.description", "'AXLabel: content information'");
shouldBeTrue("footer.childAtIndex(0).traits != nonLandmarkText.traits");
var article = accessibilityController.accessibleElementById("article");
shouldBe("article.description", "'AXLabel: article'");
shouldBeTrue("article.childAtIndex(0).traits != nonLandmarkText.traits");
var note = accessibilityController.accessibleElementById("note");
shouldBe("note.description", "'AXLabel: note'");
shouldBeTrue("note.childAtIndex(0).traits != nonLandmarkText.traits");
var documentContainer = accessibilityController.accessibleElementById("documentcontainer");
shouldBe("documentContainer.description", "'AXLabel: document'");
shouldBeTrue("documentContainer.childAtIndex(0).traits != nonLandmarkText.traits");
shouldBeTrue("region.childAtIndex(0).traits == main.childAtIndex(0).traits");
}
successfullyParsed = true;
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>