Closed Bug 1134186 Opened 9 years ago Closed 9 years ago

Mock shellService in XPCSHELL tests for TelemetryEnvironment

Categories

(Firefox Health Report Graveyard :: Client: Desktop, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: Dexter, Unassigned)

References

Details

TelemetryEnvironment uses the shellService to detect if Firefox is the default browser. In XPCSHELL tests this is not possible. We should Mock shellService to get rid of the exception.

0:04.81 LOG: Thread-1 INFO "CONSOLE_MESSAGE: (warn) [JavaScript Error: "1424268147096	Toolkit.Telemetry	ERROR	TelemetryEnvironment::_isDefaultBrowser - Could not obtain shell service: TypeError: Cc['@mozilla.org/browser/shell-service;1'] is undefined (resource://gre/modules/TelemetryEnvironment.jsm:420:6) JS Stack trace: this.TelemetryEnvironment._isDefaultBrowser@TelemetryEnvironment.jsm:420:7 < this.TelemetryEnvironment._getSettings@TelemetryEnvironment.jsm:452:25 < this.TelemetryEnvironment._doGetEnvironmentData</sections.settings@TelemetryEnvironment.jsm:913:25 < this.TelemetryEnvironment._doGetEnvironmentData<@TelemetryEnvironment.jsm:926:25 < TaskImpl_run@Task.jsm:314:40 < TaskImpl_handleResultValue@Task.jsm:393:7 < TaskImpl_run@Task.jsm:322:13 < TaskImpl@Task.jsm:275:3 < createAsyncFunction/asyncFunction@Task.jsm:249:14 < this.TelemetryEnvironment.getEnvironmentData@TelemetryEnvironment.jsm:901:25 < test_checkEnvironment@test_TelemetryEnvironment.js:655:31 < TaskImpl_run@Task.jsm:314:40 < TaskImpl_handleResultValue@Task.jsm:393:7 < TaskImpl_run@Task.jsm:322:13 < TaskImpl@Task.jsm:275:3 < createAsyncFunction/asyncFunction@Task.jsm:249:14 < Task_spawn@Task.jsm:164:12 < _run_next_test@c:\\mozilla-source\\testing\\xpcshell\\head.js:1375:9 < do_execute_soon/<.run@c:\\mozilla-source\\testing\\xpcshell\\head.js:644:9 < _do_main@c:\\mozilla-source\\testing\\xpcshell\\head.js:207:5 < _execute_test@c:\\mozilla-source\\testing\\xpcshell\\head.js:504:5 < @-e:1:1" {file: "resource://gre/modules/Log.jsm" line: 749}]"
Blocks: 1069869
Assignee: nobody → alessio.placitelli
Blocks: 1134269
No longer blocks: 1069869
Blocks: 1120356
No longer blocks: 1134269
Blocks: 1137262
No longer blocks: 1120356
Assignee: alessio.placitelli → nobody
It makes more sense to add proper coverage for this with the upcoming marionette-based tests (bug 1168643).
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → WONTFIX
Product: Firefox Health Report → Firefox Health Report Graveyard
You need to log in before you can comment on or make changes to this bug.