summaryrefslogtreecommitdiffstats
path: root/dom/bindings/test
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:33 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:33 +0000
commit086c044dc34dfc0f74fbe41f4ecb402b2cd34884 (patch)
treea4f824bd33cb075dd5aa3eb5a0a94af221bbe83a /dom/bindings/test
parentAdding debian version 124.0.1-1. (diff)
downloadfirefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.tar.xz
firefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.zip
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/bindings/test')
-rw-r--r--dom/bindings/test/TestBindingHeader.h14
-rw-r--r--dom/bindings/test/TestCodeGen.webidl13
-rw-r--r--dom/bindings/test/TestInterfaceJS.sys.mjs8
-rw-r--r--dom/bindings/test/test_async_iterable.html2
-rw-r--r--dom/bindings/test/test_bug1123516_maplikesetlikechrome.xhtml4
-rw-r--r--dom/bindings/test/test_observablearray.html16
-rw-r--r--dom/bindings/test/test_observablearray_helper.html14
-rw-r--r--dom/bindings/test/test_observablearray_proxyhandler.html10
-rw-r--r--dom/bindings/test/test_promise_rejections_from_jsimplemented.html2
-rw-r--r--dom/bindings/test/test_sequence_wrapping.html2
10 files changed, 56 insertions, 29 deletions
diff --git a/dom/bindings/test/TestBindingHeader.h b/dom/bindings/test/TestBindingHeader.h
index 4a7ea91ee8..77053d9ba6 100644
--- a/dom/bindings/test/TestBindingHeader.h
+++ b/dom/bindings/test/TestBindingHeader.h
@@ -1798,6 +1798,20 @@ class TestPrefChromeOnlySCFuncConstructorForInterface : public nsISupports,
Constructor(const GlobalObject&);
};
+class TestCallbackDictUnionOverload : public nsISupports,
+ public nsWrapperCache {
+ public:
+ NS_DECL_ISUPPORTS
+ virtual nsISupports* GetParentObject();
+
+ void Overload1(bool);
+ void Overload1(TestCallback&);
+ void Overload1(const GrandparentDict&);
+ void Overload2(bool);
+ void Overload2(const GrandparentDict&);
+ void Overload2(TestCallback&);
+};
+
} // namespace dom
} // namespace mozilla
diff --git a/dom/bindings/test/TestCodeGen.webidl b/dom/bindings/test/TestCodeGen.webidl
index 577be05920..827d9c35a7 100644
--- a/dom/bindings/test/TestCodeGen.webidl
+++ b/dom/bindings/test/TestCodeGen.webidl
@@ -1535,3 +1535,16 @@ interface TestPrefChromeOnlySCFuncConstructorForInterface {
// in the generated constructor.
constructor();
};
+
+typedef (TestCallback or GrandparentDict) TestCallbackDictUnion;
+typedef (GrandparentDict or TestCallback) TestDictCallbackUnion;
+
+[Exposed=Window]
+interface TestCallbackDictUnionOverload {
+ undefined overload1(boolean arg);
+ undefined overload1(TestCallback arg);
+ undefined overload1(optional GrandparentDict arg = {});
+ undefined overload2(boolean arg);
+ undefined overload2(optional GrandparentDict arg = {});
+ undefined overload2(TestCallback arg);
+};
diff --git a/dom/bindings/test/TestInterfaceJS.sys.mjs b/dom/bindings/test/TestInterfaceJS.sys.mjs
index 53ce9d107d..ea229eda49 100644
--- a/dom/bindings/test/TestInterfaceJS.sys.mjs
+++ b/dom/bindings/test/TestInterfaceJS.sys.mjs
@@ -93,12 +93,12 @@ TestInterfaceJS.prototype = {
pingPongNullableUnion(x) {
return x;
},
- returnBadUnion(x) {
+ returnBadUnion() {
return 3;
},
- testSequenceOverload(arg) {},
- testSequenceUnion(arg) {},
+ testSequenceOverload() {},
+ testSequenceUnion() {},
testThrowError() {
throw new this._win.Error("We are an Error");
@@ -121,7 +121,7 @@ TestInterfaceJS.prototype = {
throw Cr.NS_BINDING_ABORTED;
},
- testThrowNsresultFromNative(x) {
+ testThrowNsresultFromNative() {
// We want to throw an exception that we generate from an nsresult thrown
// by a C++ component.
Services.io.notImplemented();
diff --git a/dom/bindings/test/test_async_iterable.html b/dom/bindings/test/test_async_iterable.html
index 8f1f04aea7..ed47ef4c9d 100644
--- a/dom/bindings/test/test_async_iterable.html
+++ b/dom/bindings/test/test_async_iterable.html
@@ -88,7 +88,7 @@ async function test_data_single() {
let blockingPromises = [];
for (let i = 0; i < 10; ++i) {
let unblocker;
- let promise = new Promise((resolve, reject) => {
+ let promise = new Promise((resolve) => {
unblocker = resolve;
});
unblockers.push(unblocker);
diff --git a/dom/bindings/test/test_bug1123516_maplikesetlikechrome.xhtml b/dom/bindings/test/test_bug1123516_maplikesetlikechrome.xhtml
index 724c40cbd3..be188b8fbe 100644
--- a/dom/bindings/test/test_bug1123516_maplikesetlikechrome.xhtml
+++ b/dom/bindings/test/test_bug1123516_maplikesetlikechrome.xhtml
@@ -50,9 +50,9 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1123516
ok(true, "Calling iterators via xrays should fail");
}
- setlike.forEach((v,k,t) => { is(v, win.document.documentElement, "Cross-compartment forEach works"); });
+ setlike.forEach((v) => { is(v, win.document.documentElement, "Cross-compartment forEach works"); });
TestInterfaceSetlikeNode.prototype.forEach.call(setlike,
- (v,k,t) => { is(v, win.document.documentElement, "Cross-compartment forEach works"); });
+ (v) => { is(v, win.document.documentElement, "Cross-compartment forEach works"); });
is(TestInterfaceSetlikeNode.prototype.delete.call(setlike, win.document.documentElement), true,
"Cross-compartment unwrapping/comparison delete works");
/* eslint-disable-next-line no-shadow */
diff --git a/dom/bindings/test/test_observablearray.html b/dom/bindings/test/test_observablearray.html
index 313fb67622..56e35eeca5 100644
--- a/dom/bindings/test/test_observablearray.html
+++ b/dom/bindings/test/test_observablearray.html
@@ -21,7 +21,7 @@ add_task(function testObservableArray_length() {
let deleteCallbackTests = null;
let m = new TestInterfaceObservableArray({
- setBooleanCallback(value, index) {
+ setBooleanCallback() {
setCallbackCount++;
},
deleteBooleanCallback(value, index) {
@@ -82,10 +82,10 @@ add_task(function testObservableArray_length_callback_throw() {
let deleteCallbackCount = 0;
let m = new TestInterfaceObservableArray({
- setBooleanCallback(value, index) {
+ setBooleanCallback() {
setCallbackCount++;
},
- deleteBooleanCallback(value, index) {
+ deleteBooleanCallback(value) {
deleteCallbackCount++;
if (value) {
throw new Error("deleteBooleanCallback");
@@ -268,7 +268,7 @@ add_task(function testObservableArray_setter_callback_throw() {
throw new Error("setBooleanCallback");
}
},
- deleteBooleanCallback(value, index) {
+ deleteBooleanCallback(value) {
deleteCallbackCount++;
if (value) {
throw new Error("deleteBooleanCallback");
@@ -437,7 +437,7 @@ add_task(function testObservableArray_indexed_setter_callback_throw() {
let deleteCallbackCount = 0;
let m = new TestInterfaceObservableArray({
- setBooleanCallback(value, index) {
+ setBooleanCallback(value) {
setCallbackCount++;
if (value) {
throw new Error("setBooleanCallback");
@@ -501,7 +501,7 @@ add_task(function testObservableArray_object() {
is(index, callbackIndex++, "setCallbackTests: test index argument");
isDeeply(values[index], value, "setCallbackTests: test value argument");
},
- deleteObjectCallback(value, index) {
+ deleteObjectCallback() {
deleteCallbackCount++;
},
});
@@ -521,10 +521,10 @@ add_task(function testObservableArray_object() {
add_task(function testObservableArray_xrays() {
let m = new TestInterfaceObservableArray({
- setObjectCallback(value, index) {
+ setObjectCallback() {
ok(false, "Shouldn't reach setObjectCallback");
},
- deleteObjectCallback(value, index) {
+ deleteObjectCallback() {
ok(false, "Shouldn't reach deleteObjectCallback");
},
});
diff --git a/dom/bindings/test/test_observablearray_helper.html b/dom/bindings/test/test_observablearray_helper.html
index d2b4897cac..e2f3e42c45 100644
--- a/dom/bindings/test/test_observablearray_helper.html
+++ b/dom/bindings/test/test_observablearray_helper.html
@@ -110,7 +110,7 @@ add_task(function testObservableArray_helper_replaceElementAt_callback_throw() {
let deleteCallbackCount = 0;
let m = new TestInterfaceObservableArray({
- setBooleanCallback(value, index) {
+ setBooleanCallback(value) {
setCallbackCount++;
if (value) {
throw new Error("setBooleanCallback");
@@ -170,7 +170,7 @@ add_task(function testObservableArray_helper_appendElement() {
setCallbackTests(value, index);
}
},
- deleteBooleanCallback(value, index) {
+ deleteBooleanCallback() {
deleteCallbackCount++;
},
});
@@ -211,13 +211,13 @@ add_task(function testObservableArray_helper_appendElement_callback_throw() {
let deleteCallbackCount = 0;
let m = new TestInterfaceObservableArray({
- setBooleanCallback(value, index) {
+ setBooleanCallback(value) {
setCallbackCount++;
if (value) {
throw new Error("setBooleanCallback");
}
},
- deleteBooleanCallback(value, index) {
+ deleteBooleanCallback() {
deleteCallbackCount++;
},
});
@@ -257,7 +257,7 @@ add_task(function testObservableArray_helper_removeLastElement() {
let deleteCallbackTests = null;
let m = new TestInterfaceObservableArray({
- setBooleanCallback(value, index) {
+ setBooleanCallback() {
setCallbackCount++;
},
deleteBooleanCallback(value, index) {
@@ -316,10 +316,10 @@ add_task(function testObservableArray_helper_removeLastElement_callback_throw()
let deleteCallbackCount = 0;
let m = new TestInterfaceObservableArray({
- setBooleanCallback(value, index) {
+ setBooleanCallback() {
setCallbackCount++;
},
- deleteBooleanCallback(value, index) {
+ deleteBooleanCallback(value) {
deleteCallbackCount++;
if (value) {
throw new Error("deleteBooleanCallback");
diff --git a/dom/bindings/test/test_observablearray_proxyhandler.html b/dom/bindings/test/test_observablearray_proxyhandler.html
index d7d8810981..00ef7c26b4 100644
--- a/dom/bindings/test/test_observablearray_proxyhandler.html
+++ b/dom/bindings/test/test_observablearray_proxyhandler.html
@@ -184,7 +184,7 @@ add_task(function testObservableArrayExoticObjects_defineProperty_callback_throw
const minLen = 3;
let m = new TestInterfaceObservableArray({
- setBooleanCallback(value, index) {
+ setBooleanCallback(value) {
setCallbackCount++;
if (value) {
throw new Error("setBooleanCallback");
@@ -300,7 +300,7 @@ add_task(function testObservableArrayExoticObjects_deleteProperty() {
let deleteCallbackTests = null;
let m = new TestInterfaceObservableArray({
- setBooleanCallback(value, index) {
+ setBooleanCallback() {
setCallbackCount++;
},
deleteBooleanCallback(value, index) {
@@ -384,10 +384,10 @@ add_task(function testObservableArrayExoticObjects_deleteProperty_callback_throw
let deleteCallbackCount = 0;
let m = new TestInterfaceObservableArray({
- setBooleanCallback(value, index) {
+ setBooleanCallback() {
setCallbackCount++;
},
- deleteBooleanCallback(value, index) {
+ deleteBooleanCallback(value) {
deleteCallbackCount++;
if (value) {
throw new Error("deleteBooleanCallback");
@@ -731,7 +731,7 @@ add_task(function testObservableArrayExoticObjects_set_callback_throw() {
const minLen = 3;
let m = new TestInterfaceObservableArray({
- setBooleanCallback(value, index) {
+ setBooleanCallback(value) {
setCallbackCount++;
if (value) {
throw new Error("setBooleanCallback");
diff --git a/dom/bindings/test/test_promise_rejections_from_jsimplemented.html b/dom/bindings/test/test_promise_rejections_from_jsimplemented.html
index ab7e15dc57..aba129dc3e 100644
--- a/dom/bindings/test/test_promise_rejections_from_jsimplemented.html
+++ b/dom/bindings/test/test_promise_rejections_from_jsimplemented.html
@@ -31,7 +31,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1107592
is(exn.stack, stack, "Should have the right stack in test " + testNumber);
}
- function ensurePromiseFail(testNumber, value) {
+ function ensurePromiseFail(testNumber) {
ok(false, "Test " + testNumber + " should not have a fulfilled promise");
}
diff --git a/dom/bindings/test/test_sequence_wrapping.html b/dom/bindings/test/test_sequence_wrapping.html
index 34d901fb66..2b1d657b6c 100644
--- a/dom/bindings/test/test_sequence_wrapping.html
+++ b/dom/bindings/test/test_sequence_wrapping.html
@@ -37,7 +37,7 @@ function doTest() {
win.Object.defineProperty(win.Array.prototype, "0",
{
- set(val) {
+ set() {
setterCalled = true;
},
});