Change web expose navigation id to random UUID string

This CL changes the navigation id of the LocalDOMWindow from an int to a
random UUID that is a string. The nav id increments each time there is a
soft nav or bfcache nav. Now the nav id would change to another random
UUID. This is to make the navigation id non-sequential so we can record
it into UKM.

Things to note
1, The WTF::CreateCanonicalUUIDString() is used, instead of the
Crypto::randomUUID(). These 2 are the same. The latter is used only in
v8 code and the former is used in all other places.

2, Previously the navigation is an int with a default number. So if the
nav id is the default number, we know no soft nav or bfcache nav happens.
With nav ids being UUIDs now, the nav id at the LocalDOMWindow creation
time is initiated to a UUID no different than other UUIDs generated after
each soft nav or bfcache nav. Thus by just looking UUIDs, we no longer
know if the current Dom has gone thru soft nav and bfcache nav unless we
keep the initial UUID and compare. It is not a problem. Just note the
difference.

3, The test case, PerformanceTimelineNavigationIdBrowserTest
_NonBackForwardCacheRestore is removed as now the nav id would be
re-generated and different regardless navigation type.
The other test case PerformanceTimelineNavigationIdBrowserTest
_BackForwardCacheRestore is modified accordingly. It now verifies that
each bfcache navigation would change the nav id too.

Bug: 1370937
Change-Id: Ifb18df3f267ac39e98d868e558758f400222bd43
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4507239
Reviewed-by: Bo Liu <boliu@chromium.org>
Commit-Queue: Hao Liu <haoliuk@chromium.org>
Reviewed-by: Yoav Weiss <yoavweiss@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1145615}
11 files changed
tree: bbd1fb28e09679f7d2cfe2ae75907f46d43d693d
  1. .github/
  2. .well-known/
  3. accelerometer/
  4. accessibility/
  5. accname/
  6. acid/
  7. ambient-light/
  8. animation-worklet/
  9. annotation-model/
  10. annotation-protocol/
  11. annotation-vocab/
  12. apng/
  13. appmanifest/
  14. attribution-reporting/
  15. audio-output/
  16. autoplay-policy-detection/
  17. avif/
  18. background-fetch/
  19. background-sync/
  20. badging/
  21. battery-status/
  22. beacon/
  23. bluetooth/
  24. browsing-topics/
  25. clear-site-data/
  26. client-hints/
  27. clipboard-apis/
  28. close-watcher/
  29. common/
  30. compat/
  31. compression/
  32. compute-pressure/
  33. conformance-checkers/
  34. console/
  35. contacts/
  36. content-dpr/
  37. content-index/
  38. content-security-policy/
  39. contenteditable/
  40. cookie-store/
  41. cookies/
  42. core-aam/
  43. cors/
  44. credential-management/
  45. css/
  46. custom-elements/
  47. custom-state-pseudo-class/
  48. delegated-ink/
  49. density-size-correction/
  50. deprecation-reporting/
  51. device-memory/
  52. direct-sockets/
  53. docs/
  54. document-picture-in-picture/
  55. document-policy/
  56. dom/
  57. domparsing/
  58. domxpath/
  59. dpub-aam/
  60. dpub-aria/
  61. ecmascript/
  62. editing/
  63. element-timing/
  64. encoding/
  65. encoding-detection/
  66. encrypted-media/
  67. entries-api/
  68. event-timing/
  69. eventsource/
  70. eyedropper/
  71. feature-policy/
  72. fenced-frame/
  73. fetch/
  74. file-system-access/
  75. FileAPI/
  76. fledge/
  77. focus/
  78. font-access/
  79. fonts/
  80. forced-colors-mode/
  81. fs/
  82. fullscreen/
  83. gamepad/
  84. generic-sensor/
  85. geolocation-API/
  86. geolocation-sensor/
  87. graphics-aam/
  88. graphics-aria/
  89. gyroscope/
  90. hr-time/
  91. html/
  92. html-aam/
  93. html-longdesc/
  94. html-media-capture/
  95. idle-detection/
  96. imagebitmap-renderingcontext/
  97. images/
  98. import-maps/
  99. IndexedDB/
  100. inert/
  101. infrastructure/
  102. input-device-capabilities/
  103. input-events/
  104. installedapp/
  105. interfaces/
  106. intersection-observer/
  107. intervention-reporting/
  108. is-input-pending/
  109. js/
  110. js-self-profiling/
  111. keyboard-lock/
  112. keyboard-map/
  113. largest-contentful-paint/
  114. layout-instability/
  115. lifecycle/
  116. loading/
  117. long-animation-frame/
  118. longtask-timing/
  119. magnetometer/
  120. managed/
  121. mathml/
  122. measure-memory/
  123. media/
  124. media-capabilities/
  125. media-playback-quality/
  126. media-source/
  127. mediacapture-extensions/
  128. mediacapture-fromelement/
  129. mediacapture-handle/
  130. mediacapture-image/
  131. mediacapture-insertable-streams/
  132. mediacapture-record/
  133. mediacapture-region/
  134. mediacapture-streams/
  135. mediasession/
  136. merchant-validation/
  137. mimesniff/
  138. mixed-content/
  139. mst-content-hint/
  140. navigation-api/
  141. navigation-timing/
  142. netinfo/
  143. network-error-logging/
  144. notifications/
  145. old-tests/
  146. orientation-event/
  147. orientation-sensor/
  148. page-lifecycle/
  149. page-visibility/
  150. paint-timing/
  151. parakeet/
  152. payment-handler/
  153. payment-method-basic-card/
  154. payment-method-id/
  155. payment-request/
  156. pending-beacon/
  157. performance-timeline/
  158. periodic-background-sync/
  159. permissions/
  160. permissions-policy/
  161. permissions-request/
  162. permissions-revoke/
  163. picture-in-picture/
  164. png/
  165. pointerevents/
  166. pointerlock/
  167. portals/
  168. preload/
  169. presentation-api/
  170. private-click-measurement/
  171. proximity/
  172. push-api/
  173. quirks/
  174. referrer-policy/
  175. remote-playback/
  176. reporting/
  177. requestidlecallback/
  178. resize-observer/
  179. resource-timing/
  180. resources/
  181. sanitizer-api/
  182. savedata/
  183. scheduler/
  184. screen-capture/
  185. screen-details/
  186. screen-orientation/
  187. screen-wake-lock/
  188. scroll-animations/
  189. scroll-to-text-fragment/
  190. secure-contexts/
  191. secure-payment-confirmation/
  192. selection/
  193. serial/
  194. server-timing/
  195. service-workers/
  196. shadow-dom/
  197. shape-detection/
  198. shared-storage/
  199. signed-exchange/
  200. soft-navigation-heuristics/
  201. speculation-rules/
  202. speech-api/
  203. storage/
  204. storage-access-api/
  205. streams/
  206. subapps/
  207. subresource-integrity/
  208. svg/
  209. svg-aam/
  210. timing-entrytypes-registry/
  211. tools/
  212. top-level-storage-access-api/
  213. touch-events/
  214. trust-tokens/
  215. trusted-types/
  216. ua-client-hints/
  217. uievents/
  218. upgrade-insecure-requests/
  219. url/
  220. urlpattern/
  221. user-timing/
  222. vibration/
  223. video-rvfc/
  224. virtual-keyboard/
  225. visual-viewport/
  226. wai-aria/
  227. wasm/
  228. web-animations/
  229. web-bundle/
  230. web-locks/
  231. web-nfc/
  232. web-otp/
  233. web-share/
  234. webaudio/
  235. webauthn/
  236. webcodecs/
  237. WebCryptoAPI/
  238. webdriver/
  239. webgl/
  240. webgpu/
  241. webhid/
  242. webidl/
  243. webmessaging/
  244. webmidi/
  245. webnn/
  246. webrtc/
  247. webrtc-encoded-transform/
  248. webrtc-extensions/
  249. webrtc-ice/
  250. webrtc-identity/
  251. webrtc-priority/
  252. webrtc-stats/
  253. webrtc-svc/
  254. websockets/
  255. webstorage/
  256. webtransport/
  257. webusb/
  258. webvr/
  259. webvtt/
  260. webxr/
  261. window-placement/
  262. workers/
  263. worklets/
  264. x-frame-options/
  265. xhr/
  266. .azure-pipelines.yml
  267. .gitattributes
  268. .gitignore
  269. .mailmap
  270. .taskcluster.yml
  271. CODE_OF_CONDUCT.md
  272. CODEOWNERS
  273. CONTRIBUTING.md
  274. LICENSE.md
  275. lint.ignore
  276. README.md
  277. wpt
  278. wpt.py
README.md

The web-platform-tests Project

Taskcluster CI Status documentation manifest Python 3

The web-platform-tests Project is a cross-browser test suite for the Web-platform stack. Writing tests in a way that allows them to be run in all browsers gives browser projects confidence that they are shipping software that is compatible with other implementations, and that later implementations will be compatible with their implementations. This in turn gives Web authors/developers confidence that they can actually rely on the Web platform to deliver on the promise of working across browsers and devices without needing extra layers of abstraction to paper over the gaps left by specification editors and implementors.

The most important sources of information and activity are:

  • github.com/web-platform-tests/wpt: the canonical location of the project's source code revision history and the discussion forum for changes to the code
  • web-platform-tests.org: the documentation website; details how to set up the project, how to write tests, how to give and receive peer review, how to serve as an administrator, and more
  • wpt.live: a public deployment of the test suite, allowing anyone to run the tests by visiting from an Internet-enabled browser of their choice
  • wpt.fyi: an archive of test results collected from an array of web browsers on a regular basis
  • Real-time chat room: the wpt:matrix.org matrix channel; includes participants located around the world, but busiest during the European working day.
  • Mailing list: a public and low-traffic discussion list
  • RFCs: a repo for requesting comments on substantial changes that would impact other stakeholders or users; people who work on WPT infra are encouraged to watch the repo.

If you'd like clarification about anything, don't hesitate to ask in the chat room or on the mailing list.

Setting Up the Repo

Clone or otherwise get https://github.com/web-platform-tests/wpt.

Note: because of the frequent creation and deletion of branches in this repo, it is recommended to “prune” stale branches when fetching updates, i.e. use git pull --prune (or git fetch -p && git merge).

Running the Tests

See the documentation website and in particular the system setup for running tests locally.

Command Line Tools

The wpt command provides a frontend to a variety of tools for working with and running web-platform-tests. Some of the most useful commands are:

  • wpt serve - For starting the wpt http server
  • wpt run - For running tests in a browser
  • wpt lint - For running the lint against all tests
  • wpt manifest - For updating or generating a MANIFEST.json test manifest
  • wpt install - For installing the latest release of a browser or webdriver server on the local machine.
  • wpt serve-wave - For starting the wpt http server and the WAVE test runner. For more details on how to use the WAVE test runner see the documentation.

Windows Notes

On Windows wpt commands must be prefixed with python or the path to the python binary (if python is not in your %PATH%).

python wpt [command]

Alternatively, you may also use Bash on Ubuntu on Windows in the Windows 10 Anniversary Update build, then access your windows partition from there to launch wpt commands.

Please make sure git and your text editor do not automatically convert line endings, as it will cause lint errors. For git, please set git config core.autocrlf false in your working tree.

Publication

The master branch is automatically synced to wpt.live and w3c-test.org.

Contributing

Save the Web, Write Some Tests!

Absolutely everyone is welcome to contribute to test development. No test is too small or too simple, especially if it corresponds to something for which you've noted an interoperability bug in a browser.

The way to contribute is just as usual:

  • Fork this repository (and make sure you're still relatively in sync with it if you forked a while ago).
  • Create a branch for your changes: git checkout -b topic.
  • Make your changes.
  • Run ./wpt lint as described above.
  • Commit locally and push that to your repo.
  • Create a pull request based on the above.

Issues with web-platform-tests

If you spot an issue with a test and are not comfortable providing a pull request per above to fix it, please file a new issue. Thank you!