Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Unified Diff: third_party/WebKit/LayoutTests/accessibility/title-ui-element-correctness.html

Issue 1417213006: Switch all LayoutTests to use new AX name calculation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix canvas-fallback-content-labels-expected.txt Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/accessibility/title-ui-element-correctness.html
diff --git a/third_party/WebKit/LayoutTests/accessibility/title-ui-element-correctness.html b/third_party/WebKit/LayoutTests/accessibility/title-ui-element-correctness.html
index 0db91796b77ef2f5c925bf599c7e408fddc29c4b..c0ebfd7cfd62e6da31cb1d407bed414385344fc9 100644
--- a/third_party/WebKit/LayoutTests/accessibility/title-ui-element-correctness.html
+++ b/third_party/WebKit/LayoutTests/accessibility/title-ui-element-correctness.html
@@ -49,7 +49,7 @@ if (window.testRunner && window.accessibilityController) {
function hasTitleUIElement(axElement) {
var label1 = accessibilityController.accessibleElementById("label1");
- var titleUIElement = axElement.deprecatedTitleUIElement();
+ var titleUIElement = axElement.nameElementAtIndex(0);
if (titleUIElement == null)
return false;
return titleUIElement.role == label1.role;
@@ -72,13 +72,13 @@ if (window.testRunner && window.accessibilityController) {
return accessibilityController.accessibleElementById(id);
}
- shouldBe("axElement('control1').deprecatedTitleUIElement().isEqual(axElement('label1'))", "true");
+ shouldBe("axElement('control1').nameElementAtIndex(0).isEqual(axElement('label1'))", "true");
- shouldBe("axElement('control2').deprecatedTitleUIElement().isEqual(axElement('label2'))", "true");
+ shouldBe("axElement('control2').nameElementAtIndex(0).isEqual(axElement('label2'))", "true");
// Test changing the "for" attribute dynamically.
shouldBe("hasTitleUIElement(axElement('control3'))", "false");
- shouldBe("document.getElementById('label3').setAttribute('for', 'control3'); axElement('control3').deprecatedTitleUIElement().isEqual(axElement('label3'))", "true");
+ shouldBe("document.getElementById('label3').setAttribute('for', 'control3'); axElement('control3').nameElementAtIndex(0).isEqual(axElement('label3'))", "true");
// Test unattached label element that's subsequently attached.
var label4Element = document.createElement("label");
@@ -87,7 +87,7 @@ if (window.testRunner && window.accessibilityController) {
label4Element.innerText = "Label 4";
shouldBe("var label4Element = createLabelWithIdAndForAttribute('label4', 'control4'); hasTitleUIElement(axElement('control4'))", "false");
shouldBe("document.getElementById('container').appendChild(label4Element); hasTitleUIElement(axElement('control4'))", "true");
- shouldBe("axElement('control4').deprecatedTitleUIElement().isEqual(axElement('label4'))", "true");
+ shouldBe("axElement('control4').nameElementAtIndex(0).isEqual(axElement('label4'))", "true");
// Test what happens when the label is detached.
shouldBe("label4Element.parentElement.removeChild(label4Element); hasTitleUIElement(axElement('control4'))", "false");
@@ -95,13 +95,13 @@ if (window.testRunner && window.accessibilityController) {
// Test label that gets a control reparented into it.
shouldBe("hasTitleUIElement(axElement('control5'))", "false");
- shouldBe("reparentNodeIntoContainer(document.getElementById('control5'), document.getElementById('label5')); axElement('control5').deprecatedTitleUIElement() != null", "true");
- shouldBe("axElement('control5').deprecatedTitleUIElement().isEqual(axElement('label5'))", "true");
+ shouldBe("reparentNodeIntoContainer(document.getElementById('control5'), document.getElementById('label5')); axElement('control5').nameElementAtIndex(0) != null", "true");
+ shouldBe("axElement('control5').nameElementAtIndex(0).isEqual(axElement('label5'))", "true");
// Make sure the first label is returned, even as labels are added and removed.
- shouldBe("axElement('control6').deprecatedTitleUIElement().isEqual(axElement('label6b'))", "true");
- shouldBe("newLabel6Element = createLabelWithIdAndForAttribute('label6a', 'control6'); document.body.insertBefore(newLabel6Element, document.body.firstChild); axElement('control6').deprecatedTitleUIElement().isEqual(axElement('label6a'))", "true");
- shouldBe("document.body.removeChild(newLabel6Element); axElement('control6').deprecatedTitleUIElement().isEqual(axElement('label6b'))", "true");
+ shouldBe("axElement('control6').nameElementAtIndex(0).isEqual(axElement('label6b'))", "true");
+ shouldBe("newLabel6Element = createLabelWithIdAndForAttribute('label6a', 'control6'); document.body.insertBefore(newLabel6Element, document.body.firstChild); axElement('control6').nameElementAtIndex(0).isEqual(axElement('label6a'))", "true");
+ shouldBe("document.body.removeChild(newLabel6Element); axElement('control6').nameElementAtIndex(0).isEqual(axElement('label6b'))", "true");
document.getElementById('container').style.display = 'none';
}

Powered by Google App Engine
This is Rietveld 408576698