mozilla-b2g/gaia — pull request #9544 by jrburke (2013-05-03 17:27:58+00:00)
Title: Bug 837677: email: wiring up perf test helper for email, allow for late loading of perf bridge

This wires up the PerformanceHelper to email. However it also includes some changes to the performance helper code.

The executeAsyncScript code to register the mozPerfHasListener was getting stuck in the event loop after the places in the code where PerformanceTestingHelper.dispatch() was called in the email app. I even saw this occasionally in the communications/contacts app.

So I modified shared/js/performance_testing_helper.js to store on to the dispatch data and check periodically for mozPerfHasListener. The dispatch data also uses a time offset relative to navigation.performance.fetchStart, which is closer to when the current app starts loading.

Since the event data may not be sent until later, I modified tests/performance/performance_helper_atom.js to use the timestamp in the data instead of calling performance.now() manually.