Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2019
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.67 KB | None | 0 0
  1. diff --git a/testing/talos/talos/tests/devtools/addon/content/tests/debugger/custom.js b/testing/talos/talos/tests/devtools/addon/content/tests/debugger/custom.js
  2. index 91c1781f90d0..a1d001380ce2 100644
  3. --- a/testing/talos/talos/tests/devtools/addon/content/tests/debugger/custom.js
  4. +++ b/testing/talos/talos/tests/devtools/addon/content/tests/debugger/custom.js
  5. @@ -42,6 +42,11 @@ module.exports = async function() {
  6.  
  7. // these tests are only run on custom.jsdebugger
  8. await pauseDebuggerAndLog(tab, toolbox, EXPECTED_FUNCTION);
  9. +
  10. + console.log(`>>>> BEGIN STEPPING`)
  11. + await new Promise(() => {})
  12. +
  13. +
  14. await stepDebuggerAndLog(tab, toolbox, EXPECTED_FUNCTION);
  15.  
  16. await testProjectSearch(tab, toolbox);
  17. 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
  18. index 8847c0f90bf1..d68aa329081b 100644
  19. --- a/testing/talos/talos/tests/devtools/addon/content/tests/debugger/debugger-helpers.js
  20. +++ b/testing/talos/talos/tests/devtools/addon/content/tests/debugger/debugger-helpers.js
  21. @@ -17,7 +17,19 @@ const InspectorUtils = require("InspectorUtils");
  22.  
  23. const DEBUGGER_POLLING_INTERVAL = 50;
  24.  
  25. +
  26. +const mark =
  27. + window.performance && window.performance.mark
  28. + ? window.performance.mark.bind(window.performance)
  29. + : a => {};
  30. +
  31. +const measure =
  32. + window.performance && window.performance.measure
  33. + ? window.performance.measure.bind(window.performance)
  34. + : (a, b, c) => {};
  35. +
  36. function waitForState(dbg, predicate, msg) {
  37. + const key = msg.replace(/\s+/,'_')
  38. return new Promise(resolve => {
  39. if (msg) {
  40. dump(`Waiting for state change: ${msg}\n`);
  41. @@ -28,12 +40,14 @@ function waitForState(dbg, predicate, msg) {
  42. }
  43. return resolve();
  44. }
  45. -
  46. + mark(`${key}_start`);
  47. const unsubscribe = dbg.store.subscribe(() => {
  48. if (predicate(dbg.store.getState())) {
  49. if (msg) {
  50. dump(`Finished waiting for state change: ${msg}\n`);
  51. }
  52. + mark(`${key}_end`);
  53. + measure(`waitForState_${key}`, `${key}_start`, `${key}_end`);
  54. unsubscribe();
  55. resolve();
  56. }
  57. @@ -44,6 +58,7 @@ function waitForState(dbg, predicate, msg) {
  58.  
  59. function waitForDispatch(dbg, type) {
  60. return new Promise(resolve => {
  61. + mark(`${type}_start`);
  62. dbg.store.dispatch({
  63. type: "@@service/waitUntil",
  64. predicate: action => {
  65. @@ -55,6 +70,8 @@ function waitForDispatch(dbg, type) {
  66. return false;
  67. },
  68. run: (dispatch, getState, action) => {
  69. + mark(`${type}_end`);
  70. + measure(`waitForDispatch_${type}`, `${type}_start`, `${type}_end`);
  71. resolve(action);
  72. },
  73. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement