Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #14467 from hfiguiere/bug819080-perf
Browse files Browse the repository at this point in the history
Bug 819080 - Add performance testing for the fmradio HAL r=julienw
  • Loading branch information
hfiguiere committed Mar 4, 2014
2 parents 4b0e62c + 3a9f948 commit 6d8c461
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
4 changes: 4 additions & 0 deletions apps/fm/index.html
Expand Up @@ -8,6 +8,10 @@
<link rel="resource" type="application/l10n" href="locales/locales.ini" />
<script defer src="shared/js/l10n.js"></script>
<script defer src="shared/js/async_storage.js"></script>

<!-- For perf-measurement related utilities -->
<script defer src="shared/js/performance_testing_helper.js"></script>

<script defer src="js/fm.js"></script>

</head>
Expand Down
11 changes: 9 additions & 2 deletions apps/fm/js/fm.js
Expand Up @@ -187,9 +187,14 @@ function updateFreqUI() {
}

function updatePowerUI() {
console.log('Power status: ' + (mozFMRadio.enabled ? 'on' : 'off'));
var enabled = mozFMRadio.enabled;
if (enabled) {
PerformanceTestingHelper.dispatch('fm-radio-enabled');
PerformanceTestingHelper.dispatch('startup-path-done');
}
console.log('Power status: ' + (enabled ? 'on' : 'off'));
var powerSwitch = $('power-switch');
powerSwitch.dataset.enabled = mozFMRadio.enabled;
powerSwitch.dataset.enabled = enabled;
powerSwitch.dataset.enabling = enabling;
}

Expand Down Expand Up @@ -724,6 +729,8 @@ var favoritesList = {
};

function init() {
PerformanceTestingHelper.dispatch('start');

frequencyDialer.init();

var seeking = false;
Expand Down
5 changes: 5 additions & 0 deletions apps/fm/test/unit/fm_test.js
@@ -1,5 +1,10 @@
requireApp('fm/js/fm.js');

var PerformanceTestingHelper = {
dispatch: function() { }
};


suite('FM', function() {
var tempNode;

Expand Down
6 changes: 3 additions & 3 deletions tests/performance/startup_events_test.js
Expand Up @@ -6,12 +6,12 @@ var App = require('./app');
var PerformanceHelper = requireGaia('/tests/performance/performance_helper.js');
var MarionetteHelper = requireGaia('/tests/js-marionette/helper.js');

// This test is only for communications/contacts for now.
// XXX extend to more apps.
var whitelistedApps = [
'communications/contacts',
'clock'
'clock',
'fm'
];

if (whitelistedApps.indexOf(mozTestInfo.appPath) === -1) {
return;
}
Expand Down

0 comments on commit 6d8c461

Please sign in to comment.