Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. diff --git a/testing/talos/talos/tests/devtools/addon/content/tests/debugger/debugger-helpers.js b/testing/talos/talos/tests/devtools/addon/content/tests/debugger/debugger-helpers.js
  2. index 8847c0f90bf1..57e83fb2b26f 100644
  3. --- a/testing/talos/talos/tests/devtools/addon/content/tests/debugger/debugger-helpers.js
  4. +++ b/testing/talos/talos/tests/devtools/addon/content/tests/debugger/debugger-helpers.js
  5. @@ -17,7 +17,19 @@ const InspectorUtils = require("InspectorUtils");
  6.  
  7. const DEBUGGER_POLLING_INTERVAL = 50;
  8.  
  9. +
  10. +const mark =
  11. + window.performance && window.performance.mark
  12. + ? window.performance.mark.bind(window.performance)
  13. + : a => {};
  14. +
  15. +const measure =
  16. + window.performance && window.performance.measure
  17. + ? window.performance.measure.bind(window.performance)
  18. + : (a, b, c) => {};
  19. +
  20. function waitForState(dbg, predicate, msg) {
  21. + const key = msg.replace(/\s+/,'_')
  22. return new Promise(resolve => {
  23. if (msg) {
  24. dump(`Waiting for state change: ${msg}\n`);
  25. @@ -28,12 +40,14 @@ function waitForState(dbg, predicate, msg) {
  26. }
  27. return resolve();
  28. }
  29. -
  30. + mark(`${key}_start`);
  31. const unsubscribe = dbg.store.subscribe(() => {
  32. if (predicate(dbg.store.getState())) {
  33. if (msg) {
  34. dump(`Finished waiting for state change: ${msg}\n`);
  35. }
  36. + mark(`${key}_end`);
  37. + measure(`wait_for_${key}`, `${key}_start`, `${key}_end`);
  38. unsubscribe();
  39. resolve();
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement