diff options
Diffstat (limited to 'toolkit/components/uniffi-bindgen-gecko-js/fixtures/tests/xpcshell/test_external_types.js')
-rw-r--r-- | toolkit/components/uniffi-bindgen-gecko-js/fixtures/tests/xpcshell/test_external_types.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/toolkit/components/uniffi-bindgen-gecko-js/fixtures/tests/xpcshell/test_external_types.js b/toolkit/components/uniffi-bindgen-gecko-js/fixtures/tests/xpcshell/test_external_types.js new file mode 100644 index 0000000000..e2f985cde7 --- /dev/null +++ b/toolkit/components/uniffi-bindgen-gecko-js/fixtures/tests/xpcshell/test_external_types.js @@ -0,0 +1,16 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +const ExternalTypes = ChromeUtils.importESModule( + "resource://gre/modules/RustExternalTypes.sys.mjs" +); + +add_task(async function () { + const line = new ExternalTypes.Line( + new ExternalTypes.Point(0, 0, "p1"), + new ExternalTypes.Point(2, 1, "p2") + ); + Assert.equal(await ExternalTypes.gradient(line), 0.5); + + Assert.equal(await ExternalTypes.gradient(null), 0.0); +}); |