Bug 997440 - Fix some more error reporting in crashreporter tests. r=bholley
authorBob Owen <bobowencode@gmail.com>
Tue, 20 May 2014 22:52:19 -0700
changeset 184060 93188d7e82e8af1899759562d51409f7b1adaf0f
parent 184059 267663b1b22af87082820e5115cda3ede47e1b28
child 184061 b204d8e531536288c21756fb713dea6b0b1a8faa
push id26810
push usercbook@mozilla.com
push dateWed, 21 May 2014 11:46:36 +0000
treeherdermozilla-central@50fb8c4db2fd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbholley
bugs997440
milestone32.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 997440 - Fix some more error reporting in crashreporter tests. r=bholley
toolkit/crashreporter/test/browser/head.js
--- a/toolkit/crashreporter/test/browser/head.js
+++ b/toolkit/crashreporter/test/browser/head.js
@@ -26,17 +26,23 @@ function make_fake_appdir() {
   create_subdir(crashesDir, "submitted");
 
   _provider = {
     getFile: function(prop, persistent) {
       persistent.value = true;
       if (prop == "UAppData") {
         return appD.clone();
       }
-      throw Components.results.NS_ERROR_FAILURE;
+      // Depending on timing we can get requests for other files.
+      // When we threw an exception here, in the world before bug 997440, this got lost
+      // because of the arbitrary JSContext being used in XPCWrappedJSClass::CallMethod.
+      // After bug 997440 this gets reported to our window and causes the tests to fail.
+      // So, we'll just dump out a message to the logs.
+      dump("WARNING: make_fake_appdir - fake nsIDirectoryServiceProvider - Unexpected getFile for: '" + prop + "'\n");
+      return null;
     },
     QueryInterface: function(iid) {
       if (iid.equals(Ci.nsIDirectoryServiceProvider) ||
           iid.equals(Ci.nsISupports)) {
         return this;
       }
       throw Components.results.NS_ERROR_NO_INTERFACE;
     }