Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 3 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /ua-client-hints/useragentdata.https.any.html - WPT Dashboard Interop Dashboard
- /ua-client-hints/useragentdata.https.any.worker.html - WPT Dashboard Interop Dashboard
// META: title=tests for navigator.userAgentData
test(t => {
const brands = navigator.userAgentData.brands;
assert_true(brands.every(brand => brand.brand.length < 32),
"No brand should be longer than 32 characters.");
});
test(t => {
const uaData = navigator.userAgentData.toJSON();
assert_own_property(uaData, "brands", "toJSON() output has brands member");
assert_own_property(uaData, "mobile", "toJSON() output has mobile member");
assert_own_property(uaData, "platform", "toJSON() output has platform member");
}, "test NavigatorUAData.toJSON() output");
promise_test(() => {
return navigator.userAgentData.getHighEntropyValues(["architecture"]).then(
hints => assert_true(["x86", "arm"].some(item => item == hints.architecture))
);
}, "Arch should be one of two permitted values.");