Index: third_party/WebKit/LayoutTests/accessibility/img-fallsback-to-title.html |
diff --git a/third_party/WebKit/LayoutTests/accessibility/img-fallsback-to-title.html b/third_party/WebKit/LayoutTests/accessibility/img-fallsback-to-title.html |
index 932957a8e084b0616e0919e726dae4554cba6a1b..ca5cdb7a33f536f4cac91be65cca5ba864f2ff79 100644 |
--- a/third_party/WebKit/LayoutTests/accessibility/img-fallsback-to-title.html |
+++ b/third_party/WebKit/LayoutTests/accessibility/img-fallsback-to-title.html |
@@ -5,13 +5,11 @@ |
</head> |
<body id="body"> |
-<div role="group" tabindex="0" id="images"> |
- <img alt="" height="100" width="100"> |
- <img title="test1" height="100" width="100"> |
- <img alt="alt" title="test2" height="100" width="100"> |
- <div role="img" title="test3" width="100" height="100">test</div> |
- <div role="img" alt="alt" title="test4" width="100" height="100">test</div> |
-</div> |
+ <img id="img-ignored" alt="" height="100" width="100"> |
+ <img id="img1" title="test1" height="100" width="100"> |
+ <img id="img2" alt="alt" title="test2" height="100" width="100"> |
+ <div id="img3" role="img" title="test3" width="100" height="100">test</div> |
+ <div id="img4" role="img" alt="alt" title="test4" width="100" height="100">test</div> |
<p id="description"></p> |
<div id="console"></div> |
@@ -22,34 +20,30 @@ |
if (window.accessibilityController) { |
- document.getElementById("images").focus(); |
- var imagesGroup = accessibilityController.focusedElement; |
- |
// First image should have a description of "test1" because there is no alt tag (it should use the title). |
// The title should NOT be in the description. |
- var image1 = imagesGroup.childAtIndex(0).childAtIndex(0); |
+ var image1 = accessibilityController.accessibleElementById("img1"); |
debug("Image1 name: " + image1.name); |
debug("Image1 description: " + image1.description + "<br>"); |
// Second image should use the alt tag instead of the title. |
// The description should reflect what's in the title. |
- var image2 = imagesGroup.childAtIndex(0).childAtIndex(1); |
+ var image2 = accessibilityController.accessibleElementById("img2"); |
debug("Image2 name: " + image2.name); |
debug("Image2 description: " + image2.description + "<br>"); |
// Now do the same checks for ARIA type images. |
- var image3 = imagesGroup.childAtIndex(1); |
+ var image3 = accessibilityController.accessibleElementById("img3"); |
debug("Image3 name: " + image3.name); |
debug("Image3 description: " + image3.description + "<br>"); |
// Now do the same checks for ARIA type images. |
- var image4 = imagesGroup.childAtIndex(2); |
+ var image4 = accessibilityController.accessibleElementById("img4"); |
debug("Image4 name: " + image4.name); |
debug("Image4 description: " + image4.description + "<br>"); |
// Verify that the first image (with an empty alt tag) is ignored |
- // by checking the children count of the group containing the native images == 2. |
- shouldBe("imagesGroup.childAtIndex(0).childrenCount", "2"); |
+ shouldBe("accessibilityController.accessibleElementById('img-ignored')", "undefined"); |
} |
</script> |