Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
- index 8847c0f90bf1..57e83fb2b26f 100644
- --- 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
- @@ -17,7 +17,19 @@ const InspectorUtils = require("InspectorUtils");
- const DEBUGGER_POLLING_INTERVAL = 50;
- +
- +const mark =
- + window.performance && window.performance.mark
- + ? window.performance.mark.bind(window.performance)
- + : a => {};
- +
- +const measure =
- + window.performance && window.performance.measure
- + ? window.performance.measure.bind(window.performance)
- + : (a, b, c) => {};
- +
- function waitForState(dbg, predicate, msg) {
- + const key = msg.replace(/\s+/,'_')
- return new Promise(resolve => {
- if (msg) {
- dump(`Waiting for state change: ${msg}\n`);
- @@ -28,12 +40,14 @@ function waitForState(dbg, predicate, msg) {
- }
- return resolve();
- }
- -
- + mark(`${key}_start`);
- const unsubscribe = dbg.store.subscribe(() => {
- if (predicate(dbg.store.getState())) {
- if (msg) {
- dump(`Finished waiting for state change: ${msg}\n`);
- }
- + mark(`${key}_end`);
- + measure(`wait_for_${key}`, `${key}_start`, `${key}_end`);
- unsubscribe();
- resolve();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement