Skip to content

Commit

Permalink
Bug 873397 - [Buri][STK]idle mode text should still display after vie…
Browse files Browse the repository at this point in the history
…w (tests - mock without timeout)
  • Loading branch information
Fernando Rodriguez Sela committed Apr 16, 2014
1 parent 6c8262a commit b6660d4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 3 additions & 1 deletion apps/system/test/unit/icc_worker_test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

/* global MocksHelper, MockNavigatorMozIccManager, MockSystemICC, icc_worker */
/* global MocksHelper, MockNavigatorMozIccManager, MockSystemICC, icc_worker,
MockNotifications */

requireApp('system/test/unit/mock_l10n.js');
requireApp('system/test/unit/mock_system_icc.js');
Expand Down Expand Up @@ -132,6 +133,7 @@ suite('STK (icc_worker) >', function() {
done();
};
launchStkCommand(stkTestCommands.STK_CMD_SET_UP_IDLE_MODE_TEXT);
MockNotifications[0].onshow();
});

test('STK_CMD_REFRESH', function(done) {
Expand Down
7 changes: 3 additions & 4 deletions shared/test/unit/mocks/mock_notification.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
'use strict';

var MockNotifications = [];

/**
* This mock partly implements a Web Notification contructor, see
* https://developer.mozilla.org/en-US/docs/Web/API/notification
Expand All @@ -12,10 +14,7 @@ function MockNotification(title, options) {
this.tag = options.tag || undefined;
this.mEvents = {};

var self = this;
setTimeout(function() {
self.onshow();
});
MockNotifications.push(this);
}

MockNotification.prototype.close = function() {
Expand Down

0 comments on commit b6660d4

Please sign in to comment.