Bug 1422697 - Changed crash reporter detection in unit test r=whimboo
Since the crash reporter interface was made available all the time,
the check for the enabled state of the crash reporter had to be made
via AppConstants.jsm
MozReview-Commit-ID: LPkBVEjBB5o
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_crash.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_crash.py
@@ -21,23 +21,18 @@ from mozrunner.base import runner
class MockMozCrash(object):
"""Mock object to replace original mozcrash methods."""
def __init__(self, marionette):
self.marionette = marionette
with self.marionette.using_context('chrome'):
self.crash_reporter_enabled = self.marionette.execute_script("""
- try {
- Components.classes["@mozilla.org/toolkit/crash-reporter;1"].
- getService(Components.interfaces.nsICrashReporter);
- return true;
- } catch (exc) {
- return false;
- }
+ Cu.import("resource://gre/modules/AppConstants.jsm");
+ return AppConstants.MOZ_CRASHREPORTER;
""")
def check_for_crashes(self, dump_directory, *args, **kwargs):
if self.crash_reporter_enabled:
# Workaround until bug 1376795 has been fixed
# Wait at maximum 5s for the minidump files being created
# minidump_files = glob.glob('{}/*.dmp'.format(dump_directory))
try: