Bug 1821955 part 3: Remove CtW pref checks from tests. r=eeejay,taskgraph-reviewers,bhearsum

Differential Revision: https://phabricator.services.mozilla.com/D177720
This commit is contained in:
James Teh 2023-05-19 02:56:48 +00:00
Родитель ff0d0a5f86
Коммит 5590870312
30 изменённых файлов: 178 добавлений и 354 удалений

Просмотреть файл

@ -47,9 +47,8 @@ function testBoundsWithOffset(browser, iframeDocAcc, id, domElmBounds, offset) {
// getContentBoundsForDOMElm's result doesn't include iframe translation
// for in-process iframes, but does for out-of-process iframes. To account
// for that here, manually add in the translation offset when examining an
// in-process iframe. This manual adjustment isn't necessary without the cache
// since, without it, accessible bounds don't include the translation offset either.
const addTranslationOffset = !gIsRemoteIframe && isCacheEnabled;
// in-process iframe.
const addTranslationOffset = !gIsRemoteIframe;
const expectedX = addTranslationOffset
? domElmBounds[0] + offset
: domElmBounds[0];
@ -158,8 +157,8 @@ addAccessibleTask(
{
chrome: false,
topLevel: false,
iframe: isCacheEnabled /* works, but timing is tricky with no cache */,
remoteIframe: isCacheEnabled /* works, but timing is tricky with no cache */,
iframe: true,
remoteIframe: true,
iframeAttrs: { style: "width: 0;" },
}
);

Просмотреть файл

@ -90,27 +90,25 @@ addAccessibleTask(
</div>
`,
async function(browser, docAcc) {
if (isCacheEnabled) {
// Even though willChangeTop has no transform, it has
// will-change: transform, which means nsIFrame::IsTransformed returns
// true. We don't cache identity matrices, but because there is an offset
// to the root frame, layout includes this in the returned transform
// matrix. That means we get a non-identity matrix and thus we cache it.
// This is why we only test the identity matrix cache optimization for
// willChangeInner.
let hasTransform;
try {
const willChangeInner = findAccessibleChildByID(
docAcc,
"willChangeInner"
);
willChangeInner.cache.getStringProperty("transform");
hasTransform = true;
} catch (e) {
hasTransform = false;
}
ok(!hasTransform, "willChangeInner has no cached transform");
// Even though willChangeTop has no transform, it has
// will-change: transform, which means nsIFrame::IsTransformed returns
// true. We don't cache identity matrices, but because there is an offset
// to the root frame, layout includes this in the returned transform
// matrix. That means we get a non-identity matrix and thus we cache it.
// This is why we only test the identity matrix cache optimization for
// willChangeInner.
let hasTransform;
try {
const willChangeInner = findAccessibleChildByID(
docAcc,
"willChangeInner"
);
willChangeInner.cache.getStringProperty("transform");
hasTransform = true;
} catch (e) {
hasTransform = false;
}
ok(!hasTransform, "willChangeInner has no cached transform");
await testBoundsWithContent(docAcc, "willChangeTopP2", browser);
await testBoundsWithContent(docAcc, "willChangeInnerP2", browser);
},

Просмотреть файл

@ -131,10 +131,10 @@ addAccessibleTask(
}
},
{
// These tests don't work yet with the parent process cache enabled.
topLevel: !isCacheEnabled,
iframe: !isCacheEnabled,
remoteIframe: !isCacheEnabled,
// These tests don't work yet with the parent process cache.
topLevel: false,
iframe: false,
remoteIframe: false,
}
);
@ -617,7 +617,7 @@ addAccessibleTask(
async function(browser, docAcc) {
const noAlt = findAccessibleChildByID(docAcc, "noAlt");
testAttrs(noAlt, { src: kImgUrl }, true);
if (isCacheEnabled && browser.isRemoteBrowser) {
if (browser.isRemoteBrowser) {
// To avoid wasting memory, we don't cache src if there's a name.
const alt = findAccessibleChildByID(docAcc, "alt");
testAbsentAttrs(alt, { src: "" });

Просмотреть файл

@ -16,25 +16,17 @@ addAccessibleTask(
let contentPromise = invokeContentTask(browser, [], () => {
content.document.getElementById("div").id = "foo";
});
// When the cache is enabled, we don't await for content task to return
// because we want to exercise the untilCacheIs function and
// demonstrate that it can await for a passing `is` test.
if (!isCacheEnabled) {
// However, when the cache is disabled, we must await it because there
// will never be a cache update.
await contentPromise;
}
// We don't await for content task to return because we want to exercise the
// untilCacheIs function and demonstrate that it can await for a passing
// `is` test.
await untilCacheIs(
() => div.id,
"foo",
"ID is correct and updated in cache"
);
if (isCacheEnabled) {
// Don't leave test without the content task promise resolved.
await contentPromise;
}
// Don't leave test without the content task promise resolved.
await contentPromise;
},
{ iframe: true, remoteIframe: true }
);

Просмотреть файл

@ -13,13 +13,6 @@ addAccessibleTask(
<math id="math"><mfrac><mi>x</mi><mi>y</mi></mfrac></math>
`,
async function(browser, docAcc) {
if (!isCacheEnabled) {
// Stop the harness from complaining that this file is empty when run with
// the cache disabled.
todo(false, "Cache disabled for a cache only test");
return;
}
const p = findAccessibleChildByID(docAcc, "p");
let hasHtml;
try {
@ -49,7 +42,7 @@ addAccessibleTask(
},
{
topLevel: true,
iframe: isCacheEnabled,
remoteIframe: isCacheEnabled,
iframe: true,
remoteIframe: true,
}
);

Просмотреть файл

@ -188,7 +188,7 @@ addAccessibleTask(
{
// We can only access the `cache` attribute of an accessible when
// the cache is enabled and we're in a remote browser.
topLevel: isCacheEnabled,
iframe: isCacheEnabled,
topLevel: true,
iframe: true,
}
);

Просмотреть файл

@ -175,9 +175,9 @@ addAccessibleTask(
},
{
chrome: true,
topLevel: isCacheEnabled,
iframe: isCacheEnabled,
remoteIframe: isCacheEnabled,
topLevel: true,
iframe: true,
remoteIframe: true,
}
);
@ -285,5 +285,5 @@ addAccessibleTask(
async function(browser, accDoc) {
await testCachedRelation(accDoc, RELATION_NODE_CHILD_OF, accDoc.parent);
},
{ topLevel: isCacheEnabled, chrome: true }
{ topLevel: true, chrome: true }
);

Просмотреть файл

@ -115,9 +115,9 @@ addAccessibleTask(
},
{
chrome: false,
iframe: isCacheEnabled,
remoteIframe: isCacheEnabled,
topLevel: isCacheEnabled,
iframe: true,
remoteIframe: true,
topLevel: true,
}
);
@ -238,8 +238,8 @@ addAccessibleTask(
* so we avoid running this test in chrome or when the cache is off.
*/
chrome: false,
iframe: isCacheEnabled,
remoteIframe: isCacheEnabled,
topLevel: isCacheEnabled,
iframe: true,
remoteIframe: true,
topLevel: true,
}
);

Просмотреть файл

@ -74,9 +74,9 @@ addAccessibleTask(
},
{
chrome: true,
topLevel: isCacheEnabled,
iframe: isCacheEnabled,
remoteIframe: isCacheEnabled,
topLevel: true,
iframe: true,
remoteIframe: true,
}
);
@ -111,9 +111,9 @@ addAccessibleTask(
},
{
chrome: true,
topLevel: isCacheEnabled,
iframe: isCacheEnabled,
remoteIframe: isCacheEnabled,
topLevel: true,
iframe: true,
remoteIframe: true,
}
);
@ -154,9 +154,9 @@ addAccessibleTask(
},
{
chrome: true,
topLevel: isCacheEnabled,
iframe: isCacheEnabled,
remoteIframe: isCacheEnabled,
topLevel: true,
iframe: true,
remoteIframe: true,
}
);
@ -192,9 +192,9 @@ addAccessibleTask(
},
{
chrome: true,
topLevel: isCacheEnabled,
iframe: isCacheEnabled,
remoteIframe: isCacheEnabled,
topLevel: true,
iframe: true,
remoteIframe: true,
}
);
@ -279,15 +279,10 @@ addAccessibleTask(
const layout = findAccessibleChildByID(docAcc, "layout");
testAttrs(layout, { "layout-guess": "true" }, true);
info("changing border style on table cell");
let styleChanged = waitForEvent(EVENT_TABLE_STYLING_CHANGED, layout);
await invokeContentTask(browser, [], () => {
content.document.getElementById("cell").style.border = "1px solid black";
content.document.body.offsetTop; // Flush layout.
});
if (!isCacheEnabled) {
// this event doesn't get fired when the cache is on, so we can't await it
await styleChanged;
}
await untilCacheOk(() => {
// manually verify the attribute doesn't exist, since `testAbsentAttrs`
// has internal calls to ok() which fail if the cache hasn't yet updated
@ -350,9 +345,9 @@ addAccessibleTask(
},
{
chrome: true,
topLevel: isCacheEnabled,
iframe: isCacheEnabled,
remoteIframe: isCacheEnabled,
topLevel: true,
iframe: true,
remoteIframe: true,
}
);
@ -406,26 +401,19 @@ addAccessibleTask(
await setNodeHidden(browser, "b", false);
await reordered;
is(table.columnCount, 2, "table columnCount correct");
if (isCacheEnabled) {
info("Moving b out of table using aria-owns");
reordered = waitForEvent(EVENT_REORDER, "r1");
await invokeContentTask(browser, [], () => {
content.document.getElementById("owner").setAttribute("aria-owns", "b");
});
await reordered;
is(table.columnCount, 1, "table columnCount correct");
} else {
todo(
false,
"CachedTableAccessible disabled, so counts broken when cell moved with aria-owns"
);
}
info("Moving b out of table using aria-owns");
reordered = waitForEvent(EVENT_REORDER, "r1");
await invokeContentTask(browser, [], () => {
content.document.getElementById("owner").setAttribute("aria-owns", "b");
});
await reordered;
is(table.columnCount, 1, "table columnCount correct");
},
{
chrome: true,
topLevel: isCacheEnabled,
iframe: isCacheEnabled,
remoteIframe: isCacheEnabled,
topLevel: true,
iframe: true,
remoteIframe: true,
}
);
@ -451,9 +439,9 @@ addAccessibleTask(
},
{
chrome: true,
topLevel: isCacheEnabled,
iframe: isCacheEnabled,
remoteIframe: isCacheEnabled,
topLevel: true,
iframe: true,
remoteIframe: true,
}
);
@ -486,9 +474,9 @@ addAccessibleTask(
},
{
chrome: true,
topLevel: isCacheEnabled,
iframe: isCacheEnabled,
remoteIframe: isCacheEnabled,
topLevel: true,
iframe: true,
remoteIframe: true,
}
);

Просмотреть файл

@ -227,9 +227,7 @@ addAccessibleTask(
async function(browser, accDoc) {
info("Testing multiline RtL text");
await testTextNode(accDoc, browser, "p4");
if (!isCacheEnabled) {
await testTextNode(accDoc, browser, "p5"); // w/ cache fails x, w - off by one char
}
//await testTextNode(accDoc, browser, "p5"); // w/ cache fails x, w - off by one char
// await testTextNode(accDoc, browser, "p6"); // w/o cache, fails width (a 259, e 250), w/ cache fails w, h in iframe (line wrapping)
await testTextNode(accDoc, browser, "p7");
},
@ -291,8 +289,8 @@ addAccessibleTask(
await testTextNode(accDoc, browser, "p6");
},
{
topLevel: isCacheEnabled,
iframe: isCacheEnabled,
topLevel: true,
iframe: true,
}
);
@ -315,8 +313,8 @@ addAccessibleTask(
// await testTextNode(accDoc, browser, "p4"); // off by 4 with caching, iframe
},
{
topLevel: isCacheEnabled,
iframe: isCacheEnabled,
topLevel: true,
iframe: true,
}
);

Просмотреть файл

@ -87,14 +87,7 @@ ef gh</pre>
[7, 8, " cd", 2, 5],
[9, 11, "\nef", 5, 8],
]);
if (id == "br" && !isCacheEnabled) {
todo(
false,
"Cache disabled, so TextBeforeOffset BOUNDARY_WORD_END returns incorrect result after br"
);
} else {
testTextBeforeOffset(acc, BOUNDARY_WORD_END, [[6, 6, " cd", 2, 5]]);
}
testTextBeforeOffset(acc, BOUNDARY_WORD_END, [[6, 6, " cd", 2, 5]]);
testTextAfterOffset(acc, BOUNDARY_WORD_END, [
[0, 2, " cd", 2, 5],
[3, 5, "\nef", 5, 8],
@ -119,18 +112,6 @@ ef gh</pre>
[1, 1, `a${kEmbedChar}d`, 0, 3],
[2, 3, `${kEmbedChar}d`, 1, 3],
]);
if (isCacheEnabled) {
testTextAtOffset(linksBreaking, BOUNDARY_WORD_START, [
[0, 0, `a${kEmbedChar}`, 0, 2],
[1, 1, `a${kEmbedChar}d`, 0, 3],
[2, 3, `${kEmbedChar}d`, 1, 3],
]);
} else {
todo(
false,
"TextLeafPoint disabled, so word boundaries are incorrect for linksBreaking"
);
}
const p = findAccessibleChildByID(docAcc, "p");
testTextAtOffset(p, BOUNDARY_LINE_START, [
[0, 0, "a", 0, 1],
@ -213,10 +194,10 @@ addAccessibleTask(
// different offsets. This doesn't matter because they're invalid either
// way. Since the new HyperTextAccessibleBase implementation is all we will
// have soon, just test that.
chrome: isCacheEnabled,
topLevel: isCacheEnabled,
iframe: isCacheEnabled,
remoteIframe: isCacheEnabled,
chrome: true,
topLevel: true,
iframe: true,
remoteIframe: true,
}
);
@ -341,8 +322,8 @@ addAccessibleTask(
},
{
chrome: true,
topLevel: isCacheEnabled,
iframe: isCacheEnabled,
remoteIframe: isCacheEnabled,
topLevel: true,
iframe: true,
remoteIframe: true,
}
);

Просмотреть файл

@ -59,13 +59,6 @@ function testSelectionRange(
endContainer,
endOffset
) {
if (browser.isRemoteBrowser && !isCacheEnabled) {
todo(
false,
"selectionRanges not implemented for non-cached RemoteAccessible"
);
return;
}
let selRange = root.selectionRanges.queryElementAt(0, nsIAccessibleTextRange);
testTextRange(
selRange,
@ -153,7 +146,7 @@ addAccessibleTask(
testTextGetSelection(editable, 0, 1, 0);
testTextGetSelection(p1, 0, 1, 0);
const p2 = findAccessibleChildByID(docAcc, "p2", [nsIAccessibleText]);
if (isCacheEnabled && browser.isRemoteBrowser) {
if (browser.isRemoteBrowser) {
is(p2.selectionCount, 0, "p2 selectionCount is 0");
} else {
todo(
@ -212,35 +205,28 @@ addAccessibleTask(
content.window.getSelection().addRange(r);
});
await selChanged;
if (browser.isRemoteBrowser && !isCacheEnabled) {
todo(
false,
"selectionRanges not implemented for non-cached RemoteAccessible"
);
} else {
let selRanges = editable.selectionRanges;
is(selRanges.length, 2, "2 selection ranges");
testTextRange(
selRanges.queryElementAt(0, nsIAccessibleTextRange),
"range 0",
p1,
0,
p1,
1
);
testTextRange(
selRanges.queryElementAt(1, nsIAccessibleTextRange),
"range 1",
p2,
0,
p2,
1
);
}
let selRanges = editable.selectionRanges;
is(selRanges.length, 2, "2 selection ranges");
testTextRange(
selRanges.queryElementAt(0, nsIAccessibleTextRange),
"range 0",
p1,
0,
p1,
1
);
testTextRange(
selRanges.queryElementAt(1, nsIAccessibleTextRange),
"range 1",
p2,
0,
p2,
1
);
is(editable.selectionCount, 2, "editable selectionCount is 2");
testTextGetSelection(editable, 0, 1, 0);
testTextGetSelection(editable, 1, 2, 1);
if (isCacheEnabled && browser.isRemoteBrowser) {
if (browser.isRemoteBrowser) {
is(p1.selectionCount, 1, "p1 selectionCount is 1");
testTextGetSelection(p1, 0, 1, 0);
is(p2.selectionCount, 1, "p2 selectionCount is 1");

Просмотреть файл

@ -144,8 +144,8 @@ addAccessibleTask(
},
{
chrome: true,
topLevel: isCacheEnabled,
iframe: isCacheEnabled,
remoteIframe: isCacheEnabled,
topLevel: true,
iframe: true,
remoteIframe: true,
}
);

Просмотреть файл

@ -314,10 +314,7 @@ async function testIsLayout(table, elem, event, change, isLayout) {
event == EVENT_TABLE_STYLING_CHANGED ? "table" : elem
);
await change();
if (event != EVENT_TABLE_STYLING_CHANGED || !isCacheEnabled) {
// We can't wait for this event when the cache is on because
// we don't fire it. Instead we rely on the `untilCacheIs` check
// below.
if (event != EVENT_TABLE_STYLING_CHANGED) {
await toWait;
}
let intendedRole = isLayout ? "AXGroup" : "AXTable";

Просмотреть файл

@ -84,17 +84,13 @@ function testLines(
expectedLeft,
expectedRight
) {
if (!isCacheEnabled && expectedLine != expectedLeft) {
todo(false, `${msg}: line broken at start with cache disabled`);
} else {
testRangeAtMarker(
macDoc,
marker,
"AXLineTextMarkerRangeForTextMarker",
expectedLine,
`${msg}: line matches`
);
}
testRangeAtMarker(
macDoc,
marker,
"AXLineTextMarkerRangeForTextMarker",
expectedLine,
`${msg}: line matches`
);
testRangeAtMarker(
macDoc,
@ -254,24 +250,21 @@ addAccessibleTask("mac/doc_textmarker_test.html", async (browser, accDoc) => {
return content.wrappedJSObject.EXPECTED;
});
if (isCacheEnabled) {
// Some changes in expected results when cache is enabled
// These are more correct return values (or at least not more incorrect)
expectedValues[231].words[1] = "Skip'";
expectedValues[248].lines[1] = "These ";
expectedValues[252].lines[1] = "are ";
expectedValues[255].lines[1] = "my ";
expectedValues[261].words[0] = expectedValues[261].words[1] = "awards,";
expectedValues[263].lines[1] = "awards, ";
expectedValues[269].words[0] = expectedValues[269].words[1] = "Mother.";
expectedValues[271].lines[1] = "Mother. ";
expectedValues[276].lines[1] = "From ";
expectedValues[269].paragraph = "These are my awards, Mother. From Army.";
expectedValues[283].words[0] = "deceived";
expectedValues[295].paragraph = "I deceived you, mom.";
expectedValues[295].words[0] = "";
expectedValues[297].words[0] = " ";
}
// XXX Merge these changes into doc_textmarker_test.html.
expectedValues[231].words[1] = "Skip'";
expectedValues[248].lines[1] = "These ";
expectedValues[252].lines[1] = "are ";
expectedValues[255].lines[1] = "my ";
expectedValues[261].words[0] = expectedValues[261].words[1] = "awards,";
expectedValues[263].lines[1] = "awards, ";
expectedValues[269].words[0] = expectedValues[269].words[1] = "Mother.";
expectedValues[271].lines[1] = "Mother. ";
expectedValues[276].lines[1] = "From ";
expectedValues[269].paragraph = "These are my awards, Mother. From Army.";
expectedValues[283].words[0] = "deceived";
expectedValues[295].paragraph = "I deceived you, mom.";
expectedValues[295].words[0] = "";
expectedValues[297].words[0] = " ";
testMarkerIntegrity(accDoc, expectedValues);
});

Просмотреть файл

@ -178,10 +178,6 @@ function testSelectionEventLeftChar(event, expectedChar) {
}
function testSelectionEventLine(event, expectedLine) {
if (!expectedLine && !isCacheEnabled) {
todo(false, "Blank lines are broken with cache disabled");
return;
}
const selStart = event.macIface.getParameterizedAttributeValue(
"AXStartTextMarkerForTextMarkerRange",
event.data.AXSelectedTextMarkerRange

Просмотреть файл

@ -84,5 +84,5 @@ addAccessibleTask(
// Some roles can't be mapped to ARIA role tokens.
testComputedARIARole("iframe", "");
},
{ chrome: true, topLevel: isCacheEnabled }
{ chrome: true, topLevel: true }
);

Просмотреть файл

@ -102,13 +102,6 @@ addAccessibleTask(
</div>
`,
async function(browser, docAcc) {
// We can only access the `cache` attribute of an accessible when
// the cache is enabled and we're in a remote browser. Verify
// both these conditions hold, and return early if they don't.
if (!isCacheEnabled || !browser.isRemoteBrowser) {
return;
}
ok(docAcc, "iframe document acc is present");
await untilCacheOk(
() => testCachedScrollPosition(docAcc, 0, 0),
@ -627,13 +620,6 @@ addAccessibleTask(
</div>
`,
async function(browser, docAcc) {
// We can only access the `cache` attribute of an accessible when
// the cache is enabled and we're in a remote browser. Verify
// both these conditions hold, and return early if they don't.
if (!isCacheEnabled || !browser.isRemoteBrowser) {
return;
}
const square = findAccessibleChildByID(docAcc, "square");
await untilCacheOk(
() => testCachedScrollPosition(square, 0, 0, true),

Просмотреть файл

@ -65,7 +65,7 @@ async function testMultiSelectable(widget, selectableChildren, msg = "") {
let success = widget.selectAll();
ok(success, `${msg}: selectAll success`);
await promise;
if (isRemote && isCacheEnabled) {
if (isRemote) {
await untilCacheIs(
() => widget.selectedItemCount,
selectableChildren.length,
@ -77,7 +77,7 @@ async function testMultiSelectable(widget, selectableChildren, msg = "") {
promise = multipleSelectionChanged(widget, selectableChildren, false);
widget.unselectAll();
await promise;
if (isRemote && isCacheEnabled) {
if (isRemote) {
await untilCacheIs(
() => widget.selectedItemCount,
0,

Просмотреть файл

@ -8,7 +8,7 @@
/* import-globals-from ../mochitest/layout.js */
/* import-globals-from ../mochitest/promisified-events.js */
/* exported Logger, MOCHITESTS_DIR, isCacheEnabled, invokeSetAttribute, invokeFocus,
/* exported Logger, MOCHITESTS_DIR, invokeSetAttribute, invokeFocus,
invokeSetStyle, getAccessibleDOMNodeID, getAccessibleTagName,
addAccessibleTask, findAccessibleChildByID, isDefunct,
CURRENT_CONTENT_DIR, loadScripts, loadContentScripts, snippetToURL,
@ -44,11 +44,6 @@ const DEFAULT_IFRAME_DOC_BODY_ID = "default-iframe-body-id";
const HTML_MIME_TYPE = "text/html";
const XHTML_MIME_TYPE = "application/xhtml+xml";
const isCacheEnabled = Services.prefs.getBoolPref(
"accessibility.cache.enabled",
false
);
function loadHTMLFromFile(path) {
// Load the HTML to return in the response from file.
// Since it's relative to the cwd of the test runner, we start there and

Просмотреть файл

@ -21,7 +21,7 @@ addAccessibleTask(
"select should be on screen and visible"
);
if (!isCacheEnabled || !browser.isRemoteBrowser) {
if (!browser.isRemoteBrowser) {
await untilCacheOk(
() => testVisibility(select.firstChild, false, true),
"combobox list should be on screen and invisible"

Просмотреть файл

@ -76,9 +76,8 @@ async function runTest(browser, accDoc) {
() => testVisibility(getAcc("frame"), true, false),
"iframe outer doc should now be off screen"
);
// See bug 1792256
await untilCacheOk(
() => !isCacheEnabled || testVisibility(iframeDoc, true, false),
() => testVisibility(iframeDoc, true, false),
"iframe inner doc should now be off screen"
);
await untilCacheOk(
@ -98,9 +97,8 @@ async function runTest(browser, accDoc) {
() => testVisibility(getAcc("frame"), true, false),
"iframe outer doc should still be off screen"
);
// See bug 1792256
await untilCacheOk(
() => !isCacheEnabled || testVisibility(iframeDoc, true, false),
() => testVisibility(iframeDoc, true, false),
"iframe inner doc should still be off screen"
);
await untilCacheOk(
@ -122,7 +120,7 @@ addAccessibleTask(
<iframe id="frame"></iframe>
`,
runTest,
{ chrome: !isCacheEnabled, iframe: true, remoteIframe: true }
{ iframe: true, remoteIframe: true }
);
/**

Просмотреть файл

@ -172,7 +172,7 @@ the <strong>big</strong> rug.</p>
"Backward BOUNDARY_LINE_END sequence is correct"
);
},
{ chrome: true, topLevel: isCacheEnabled, iframe: false, remoteIframe: false }
{ chrome: true, topLevel: true, iframe: false, remoteIframe: false }
);
addAccessibleTask(
@ -241,7 +241,7 @@ addAccessibleTask(
}
);
},
{ chrome: true, topLevel: isCacheEnabled, iframe: false, remoteIframe: false }
{ chrome: true, topLevel: true, iframe: false, remoteIframe: false }
);
addAccessibleTask(
@ -292,7 +292,7 @@ on a <span style="display: block;">rug</span></p>
"The word end from the previous block is the first point in this block"
);
},
{ chrome: true, topLevel: isCacheEnabled, iframe: false, remoteIframe: false }
{ chrome: true, topLevel: true, iframe: false, remoteIframe: false }
);
// Test for skipping list item bullets.
@ -457,7 +457,7 @@ Four</li>
{ flags: BOUNDARY_FLAG_SKIP_LIST_ITEM_MARKER }
);
},
{ chrome: true, topLevel: isCacheEnabled, iframe: false, remoteIframe: false }
{ chrome: true, topLevel: true, iframe: false, remoteIframe: false }
);
/**
@ -481,5 +481,5 @@ addAccessibleTask(
"Forward BOUNDARY_PARAGRAPH sequence is correct"
);
},
{ chrome: true, topLevel: isCacheEnabled, iframe: false, remoteIframe: false }
{ chrome: true, topLevel: true, iframe: false, remoteIframe: false }
);

Просмотреть файл

@ -59,7 +59,6 @@ skip-if = os == 'mac'
[test_selection_aria.html]
[test_statechange.html]
[test_statechange.xhtml]
[test_stylechange.html]
[test_text.html]
[test_text_alg.html]
[test_textattrchange.html]

Просмотреть файл

@ -1,66 +0,0 @@
<!doctype html>
<head>
<title>Table accessible style change event testing</title>
<link rel="stylesheet"
href="chrome://mochikit/content/tests/SimpleTest/test.css" />
<script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<script src="../common.js"></script>
<script src="../promisified-events.js"></script>
<script type="application/javascript">
async function testGotStyleChange(elem, name, value) {
let waitFor = waitForEvent(
EVENT_TABLE_STYLING_CHANGED, "table"
);
if (value) {
document.getElementById(elem).style.setProperty(name, value);
} else {
document.getElementById(elem).style.removeProperty(name);
}
await waitFor;
}
async function doTests() {
if (Services.prefs.getBoolPref(
"accessibility.cache.enabled",
false
)) {
ok(true, "This event isn't fired when the cache is on " +
"but we can't leave this test empty, or the harness complains");
} else {
info("Set new row background");
await testGotStyleChange("rowOne", "background-color", "green");
info("Remove row background");
await testGotStyleChange("rowOne", "background-color", null);
info("Change cell border");
await testGotStyleChange("cellOne", "border", "5px solid green");
info("Remove cell border");
await testGotStyleChange("cellOne", "border", null);
}
SimpleTest.finish();
}
SimpleTest.waitForExplicitFinish();
addA11yLoadEvent(doTests);
</script>
</head>
<body>
<table id="table">
<tr id="rowOne" style="background-color: red;">
<td id="cellOne">cell1</td>
<td>cell2</td>
</tr>
<tr>
<td>cell3</td>
<td>cell4</td>
</tr>
</table>
</body>
</html>

Просмотреть файл

@ -18,15 +18,6 @@ const EndPoint_End = nsIAccessibleTextRange.EndPoint_End;
const kTodo = 1; // a test is expected to fail
const kOk = 2; // a test doesn't fail
// Flag to pass to testTextAtOffset for tests fixed by TextLeafPoint.
// if TextLeafPoint is enabled, those tests should pass. If not, they
// should be expected failures.
const kOkIfCache = Services.prefs.getBoolPref(
"accessibility.cache.enabled",
false
)
? kOk
: kTodo;
/**
* Test characterCount for the given array of accessibles.

Просмотреть файл

@ -380,9 +380,9 @@
var line4 = [ // "riend "
[ "TextBeforeOffset", BOUNDARY_WORD_END,
kOkIfCache, kOkIfCache, kOkIfCache],
kOk, kOk, kOk],
[ "TextAfterOffset", BOUNDARY_WORD_END,
kOkIfCache, kOkIfCache, kOkIfCache ],
kOk, kOk, kOk ],
];
traverseTextByLines(gQueue, "ta_wrapped",
[ [ "hi ", "", 0, 3, { words: [ 0, 2 ] } ],

Просмотреть файл

@ -61,7 +61,7 @@
// XXX: see bug 634202.
testTextAtOffset(0, BOUNDARY_LINE_START, "line ", 0, 5,
"hypertext4", kOkIfCache, kOk, kOkIfCache);
"hypertext4", kOk, kOk, kOk);
// ////////////////////////////////////////////////////////////////////////
// list

Просмотреть файл

@ -13,14 +13,14 @@
function doTest() {
testTextAtOffset("line_test_1", BOUNDARY_LINE_START,
[[0, 6, "Line 1 ", 0, 7],
// See the kOkIfCache test below.
// See the kOk test below.
// [7, 7, kEmbedChar, 7, 8],
[8, 15, "Line 3 ", 8, 15]]);
testTextAtOffset(/* aOffset */ 7, BOUNDARY_LINE_START,
kEmbedChar, /* aStartOffset */ 7, /* aEndOffset */ 8,
"line_test_1",
/* returned text */ kOkIfCache,
/* returned start offset */ kOk, /* returned end offset */ kOkIfCache);
/* returned text */ kOk,
/* returned start offset */ kOk, /* returned end offset */ kOk);
// ////////////////////////////////////////////////////////////////////////
// __h__e__l__l__o__ __m__y__ __f__r__i__e__n__d__
@ -228,16 +228,16 @@
// A line with an empty display: contents leaf in the middle.
testTextAtOffset([ "displayContents" ], BOUNDARY_LINE_START,
// See the kOkIfCache test below.
// See the kOk test below.
// [ [0, 3, `a${kEmbedChar}b`, 0, 3] ]);
[ [0, 0, `a${kEmbedChar}b`, 0, 3],
[2, 3, `a${kEmbedChar}b`, 0, 3] ]);
testTextAtOffset(/* aOffset */ 1, BOUNDARY_LINE_START,
`a${kEmbedChar}b`, /* aStartOffset */ 0, /* aEndOffset */ 3,
"displayContents",
/* returned text */ kOkIfCache,
/* returned start offset */ kOkIfCache,
/* returned end offset */ kOkIfCache);
/* returned text */ kOk,
/* returned start offset */ kOk,
/* returned end offset */ kOk);
// A line which wraps, followed by a br, followed by another line.
testTextAtOffset([ "brAfterWrapped" ], BOUNDARY_LINE_START,
@ -248,28 +248,28 @@
testTextAtOffset([ "inlineInput" ], BOUNDARY_LINE_END,
[ [0, 1, "a", 0, 1],
[2, 7, `\nb ${kEmbedChar} d`, 1, 7,
[ [ 4, "inlineInput", kOkIfCache, kOk, kOkIfCache] ] ] ]);
[ [ 4, "inlineInput", kOk, kOk, kOk] ] ] ]);
testTextAtOffset([ "inlineInput2" ], BOUNDARY_LINE_END,
[ [0, 1, "a", 0, 1],
[2, 7, `\n${kEmbedChar} c d`, 1, 7,
[ [ 2, "inlineInput2", kOkIfCache, kOk, kOkIfCache] ] ] ]);
[ [ 2, "inlineInput2", kOk, kOk, kOk] ] ] ]);
testTextAtOffset([ "inlineInput3" ], BOUNDARY_LINE_END,
[ [0, 1, "a", 0, 1],
[2, 8, `\nb${kEmbedChar} c d`, 1, 8,
[ [ 3, "inlineInput3", kOkIfCache, kOkIfCache, kOkIfCache] ] ] ]);
[ [ 3, "inlineInput3", kOk, kOk, kOk] ] ] ]);
testTextAtOffset([ "inlineInput4" ], BOUNDARY_LINE_END,
[ [0, 1, "a", 0, 1],
[2, 7, `\n${kEmbedChar}b c d`, 1, 8,
[ [ 2, "inlineInput4", kOkIfCache, kOkIfCache, kOkIfCache ] ] ] ]);
[ [ 2, "inlineInput4", kOk, kOk, kOk ] ] ] ]);
testTextAtOffset(/* aOffset */ 0, BOUNDARY_LINE_START,
kEmbedChar, 0, 1, "contentEditableTable",
/* returned text */ kOkIfCache,
/* returned text */ kOk,
/* returned start offset */ kOk,
/* returned end offset */ kOkIfCache);
/* returned end offset */ kOk);
SimpleTest.finish();
}

Просмотреть файл

@ -197,14 +197,14 @@
testTextBeforeOffset(ids, BOUNDARY_WORD_END,
[ [ 0, 7, "", 0, 0 ],
[ 8, 12, "oneword", 0, 7,
[ [ 8, "ml_divbr1", kOkIfCache, kOk, kOkIfCache ],
[ 8, "ml_edivbr1", kOkIfCache, kOk, kOkIfCache ],
[ 9, "ml_divbr1", kOkIfCache, kOk, kOkIfCache ],
[ 9, "ml_edivbr1", kOkIfCache, kOk, kOkIfCache ] ] ],
[ [ 8, "ml_divbr1", kOk, kOk, kOk ],
[ 8, "ml_edivbr1", kOk, kOk, kOk ],
[ 9, "ml_divbr1", kOk, kOk, kOk ],
[ 9, "ml_edivbr1", kOk, kOk, kOk ] ] ],
[ 13, 18, "\n\ntwo", 7, 12 ],
[ 19, 19, " words", 12, 18,
[ [ 19, "ml_divbr1", kOkIfCache, kOkIfCache, kOkIfCache ],
[ 19, "ml_edivbr1", kOkIfCache, kOkIfCache, kOkIfCache ] ] ],
[ [ 19, "ml_divbr1", kOk, kOk, kOk ],
[ 19, "ml_edivbr1", kOk, kOk, kOk ] ] ],
] );
testTextAtOffset(ids, BOUNDARY_WORD_START,
@ -216,10 +216,10 @@
[ 7, 11, "\n\ntwo", 7, 12 ],
[ 12, 17, " words", 12, 18 ],
[ 18, 19, "\n", 18, 19,
[ [ 18, "ml_divbr1", kOkIfCache, kOkIfCache, kOk ],
[ 18, "ml_edivbr1", kOkIfCache, kOkIfCache, kOk ],
[ 19, "ml_divbr1", kOkIfCache, kOkIfCache, kOk ],
[ 19, "ml_edivbr1", kOkIfCache, kOkIfCache, kOk ] ] ] ]);
[ [ 18, "ml_divbr1", kOk, kOk, kOk ],
[ 18, "ml_edivbr1", kOk, kOk, kOk ],
[ 19, "ml_divbr1", kOk, kOk, kOk ],
[ 19, "ml_edivbr1", kOk, kOk, kOk ] ] ] ]);
testTextAfterOffset(ids, BOUNDARY_WORD_START,
[ [ 0, 8, "two ", 9, 13 ],
@ -229,8 +229,8 @@
[ [ 0, 7, "\n\ntwo", 7, 12 ],
[ 8, 12, " words", 12, 18 ],
[ 13, 18, "\n", 18, 19,
[ [ 18, "ml_divbr1", kOkIfCache, kOkIfCache, kOk ],
[ 18, "ml_edivbr1", kOkIfCache, kOkIfCache, kOk ] ] ],
[ [ 18, "ml_divbr1", kOk, kOk, kOk ],
[ 18, "ml_edivbr1", kOk, kOk, kOk ] ] ],
[ 19, 19, "", 19, 19 ] ]);
// a <a href="#">b</a>
@ -280,7 +280,7 @@
[ 0, 1, "a ", 0, 2 ],
[ 2, 3, `${kEmbedChar} `, 2, 4, [
// Word at offset 2 returns end offset 3, should be 4.
[ 2, "multiword_embed", kOkIfCache, kOk, kOkIfCache ]
[ 2, "multiword_embed", kOk, kOk, kOk ]
] ],
[ 4, 5, "b", 4, 5 ]
]);