Bug 1769626 [wpt PR 34080] - Add (missing) platform member to NavigatorUAData.toJSON output, a=testonly
authorMike Taylor <miketaylr@chromium.org>
Wed, 18 May 2022 03:35:05 +0000
changeset 618481 69a0d736f68d072ff62cdfeb49276915b3aa017b
parent 618480 4215d4e3a498b08d250eec832ca05990ab309bdf
child 618482 af9cdbfd7cba6d434bf9daf829aa804f8cc6f1fb
push id163295
push userwptsync@mozilla.com
push dateSun, 22 May 2022 08:42:45 +0000
treeherderautoland@28d8297085fe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1769626, 34080, 1323565, 3646649, 1004251
milestone102.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1769626 [wpt PR 34080] - Add (missing) platform member to NavigatorUAData.toJSON output, a=testonly Automatic update from web-platform-tests Add (missing) platform member to NavigatorUAData.toJSON output As platform is a low-entropy hint, it should have been included originally (but seems to have been forgotten). Bug: 1323565 Change-Id: Ic72048144cc335fdc57652ec544105c3ad38e5cf Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3646649 Reviewed-by: Dominic Farolino <dom@chromium.org> Reviewed-by: Victor Tan <victortan@chromium.org> Commit-Queue: Mike Taylor <miketaylr@chromium.org> Cr-Commit-Position: refs/heads/main@{#1004251} -- wpt-commits: 78ebac40dc10cfabd5b4f2afa076166689b86198 wpt-pr: 34080
testing/web-platform/tests/ua-client-hints/useragentdata.https.any.js
--- a/testing/web-platform/tests/ua-client-hints/useragentdata.https.any.js
+++ b/testing/web-platform/tests/ua-client-hints/useragentdata.https.any.js
@@ -1,7 +1,14 @@
 // 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");