ui: Make all unitests to jsdom-based

Today UI tests are a mixture of nodejs-based tests
and jsdom-based tests (without counting headless, which
I am going to rewrite next).
That creates unnecessary confusion and makes tests harder
to write. The real issue is that some parts of the codebase
(the code under tests) sometimes depends on DOM elements
like window.localstorage and the like. Running them in a
clean Node environment adds unnecessary boilerplate.
Today we have a mixture of tests that do hacks to run in
both DOM and Node environment (e.g., string_utils.ts)
and tests that give up and use the jsdom environment.
This CL gives up on all of them and uses jsdom everywhere
for consistency.
For now I am leaving the _unittest.ts vs _jsdom.ts suffix
and I am merging everything at the jest.config level.
If this CL sticks, will rename jsdom -> unittests in a
follow-up CL.

This CL also fixes the build.js script when using --watch:
today the HTTP server and the tests are started straight
away after the end of the tasks, but in --watch mode that's
too early because tsc and rollup happen asynchronously.

Bug: 190075400
Change-Id: I6ef8060e32924417b612c1010ae206cf4b6671c1
18 files changed
tree: b95d827d43e0fd87cf81d3a6d3759332b97657e6
  1. .github/
  2. bazel/
  3. build_overrides/
  4. buildtools/
  5. debian/
  6. docs/
  7. examples/
  8. gn/
  9. include/
  10. infra/
  11. protos/
  12. src/
  13. test/
  14. tools/
  15. ui/
  16. .clang-format
  17. .clang-tidy
  18. .gitattributes
  19. .gitignore
  20. .gn
  21. .style.yapf
  22. Android.bp
  23. Android.bp.extras
  24. BUILD
  25. BUILD.extras
  26. BUILD.gn
  27. CHANGELOG
  28. codereview.settings
  29. DIR_METADATA
  30. heapprofd.rc
  31. LICENSE
  32. meson.build
  33. METADATA
  34. MODULE_LICENSE_APACHE2
  35. OWNERS
  36. perfetto.rc
  37. PerfettoIntegrationTests.xml
  38. PRESUBMIT.py
  39. README.chromium
  40. README.md
  41. TEST_MAPPING
  42. traced_perf.rc
  43. WORKSPACE
README.md

Perfetto - System profiling, app tracing and trace analysis

Perfetto is a production-grade open-source stack for performance instrumentation and trace analysis. It offers services and libraries and for recording system-level and app-level traces, native + java heap profiling, a library for analyzing traces using SQL and a web-based UI to visualize and explore multi-GB traces.

See https://perfetto.dev/docs or the /docs/ directory for documentation.