Skip to content

Commit 44829d6

Browse files
browser(firefox): wait for pending accessibility updates (#755)
Should fix some flaky accessibility tests on Firefox for mac.
1 parent bcc920c commit 44829d6

File tree

2 files changed

+66
-3
lines changed

2 files changed

+66
-3
lines changed

browser_patches/firefox/BUILD_NUMBER

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1020
1+
1021

browser_patches/firefox/patches/bootstrap.diff

Lines changed: 65 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,63 @@
1+
diff --git a/accessible/base/NotificationController.h b/accessible/base/NotificationController.h
2+
index c6aa1cf44c8ba339704a18ebe92fe5a7751e52f5..cfe64bdda54d49ee5b11b2368a2f9856cc9ea3cf 100644
3+
--- a/accessible/base/NotificationController.h
4+
+++ b/accessible/base/NotificationController.h
5+
@@ -270,6 +270,8 @@ class NotificationController final : public EventQueue,
6+
}
7+
#endif
8+
9+
+ bool IsUpdatePendingForJugglerAccessibility() { return IsUpdatePending(); }
10+
+
11+
protected:
12+
virtual ~NotificationController();
13+
14+
diff --git a/accessible/interfaces/nsIAccessibleDocument.idl b/accessible/interfaces/nsIAccessibleDocument.idl
15+
index a91df31c96afda66f478a5a38eaa4352039c2a0b..ee777c1746284027fb3aa2f1686f8082af9d89ee 100644
16+
--- a/accessible/interfaces/nsIAccessibleDocument.idl
17+
+++ b/accessible/interfaces/nsIAccessibleDocument.idl
18+
@@ -72,4 +72,9 @@ interface nsIAccessibleDocument : nsISupports
19+
* Return the child document accessible at the given index.
20+
*/
21+
nsIAccessibleDocument getChildDocumentAt(in unsigned long index);
22+
+
23+
+ /**
24+
+ * Return whether it is updating.
25+
+ */
26+
+ readonly attribute boolean isUpdatePendingForJugglerAccessibility;
27+
};
28+
diff --git a/accessible/xpcom/xpcAccessibleDocument.cpp b/accessible/xpcom/xpcAccessibleDocument.cpp
29+
index e3dbe73f22252f11080c3f266b2309f842eba9dc..87f50fe3df7cc8f9bc26dabd5ee571cae270912a 100644
30+
--- a/accessible/xpcom/xpcAccessibleDocument.cpp
31+
+++ b/accessible/xpcom/xpcAccessibleDocument.cpp
32+
@@ -143,6 +143,15 @@ xpcAccessibleDocument::GetVirtualCursor(nsIAccessiblePivot** aVirtualCursor) {
33+
return NS_OK;
34+
}
35+
36+
+
37+
+NS_IMETHODIMP
38+
+xpcAccessibleDocument::GetIsUpdatePendingForJugglerAccessibility(bool* updating) {
39+
+ NS_ENSURE_ARG_POINTER(updating);
40+
+ *updating = Intl()->Controller()->IsUpdatePendingForJugglerAccessibility();
41+
+ return NS_OK;
42+
+}
43+
+
44+
+
45+
////////////////////////////////////////////////////////////////////////////////
46+
// xpcAccessibleDocument
47+
48+
diff --git a/accessible/xpcom/xpcAccessibleDocument.h b/accessible/xpcom/xpcAccessibleDocument.h
49+
index f042cc1081850ac60e329b70b5569f8b97d4e4dc..65bcff9b41b9471ef1427e3ea330481c194409bc 100644
50+
--- a/accessible/xpcom/xpcAccessibleDocument.h
51+
+++ b/accessible/xpcom/xpcAccessibleDocument.h
52+
@@ -48,6 +48,8 @@ class xpcAccessibleDocument : public xpcAccessibleHyperText,
53+
nsIAccessibleDocument** aDocument) final;
54+
NS_IMETHOD GetVirtualCursor(nsIAccessiblePivot** aVirtualCursor) final;
55+
56+
+ NS_IMETHOD GetIsUpdatePendingForJugglerAccessibility(bool* aUpdating) final;
57+
+
58+
/**
59+
* Return XPCOM wrapper for the internal accessible.
60+
*/
161
diff --git a/browser/installer/allowed-dupes.mn b/browser/installer/allowed-dupes.mn
262
index cf0ae812a9f9741128fac124db03fb158ca54c30..7a0657ae0784e13929daf301549151236f1e53c1 100644
363
--- a/browser/installer/allowed-dupes.mn
@@ -2109,10 +2169,10 @@ index 0000000000000000000000000000000000000000..2508cce41565023b7fee9c7b85afe8ec
21092169
+
21102170
diff --git a/testing/juggler/content/PageAgent.js b/testing/juggler/content/PageAgent.js
21112171
new file mode 100644
2112-
index 0000000000000000000000000000000000000000..37ab5f56739cfd16200a4ada9f4cf83436688eba
2172+
index 0000000000000000000000000000000000000000..9e10bd1eb3c1c3dd800e244a2372205a2818e6c5
21132173
--- /dev/null
21142174
+++ b/testing/juggler/content/PageAgent.js
2115-
@@ -0,0 +1,843 @@
2175+
@@ -0,0 +1,846 @@
21162176
+"use strict";
21172177
+const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
21182178
+const Ci = Components.interfaces;
@@ -2820,6 +2880,9 @@ index 0000000000000000000000000000000000000000..37ab5f56739cfd16200a4ada9f4cf834
28202880
+ const document = this._frameTree.mainFrame().domWindow().document;
28212881
+ const docAcc = service.getAccessibleFor(document);
28222882
+
2883+
+ while (docAcc.document.isUpdatePendingForJugglerAccessibility)
2884+
+ await new Promise(x => this._frameTree.mainFrame().domWindow().requestAnimationFrame(x));
2885+
+
28232886
+ async function waitForQuiet() {
28242887
+ let state = {};
28252888
+ docAcc.getState(state, {});

0 commit comments

Comments
 (0)