Bug 1077282: Work around the fact that mozharness is not yet aware of the new GreD on OSX (bug 1080338). r=bsmedberg
authorStephen Pohl <spohl.mozilla.bugs@gmail.com>
Fri, 10 Oct 2014 15:07:06 -0400
changeset 209882 d3a3560432b0508f874d6edad36e93fece092456
parent 209881 a2a359d3faecc2f593e4ce06c094a8896c78fe82
child 209883 1fb3f954952bd74de01c2502918f13e0b1d5836b
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersbsmedberg
bugs1077282, 1080338
milestone35.0a1
Bug 1077282: Work around the fact that mozharness is not yet aware of the new GreD on OSX (bug 1080338). r=bsmedberg
startupcache/test/TestStartupCache.cpp
--- a/startupcache/test/TestStartupCache.cpp
+++ b/startupcache/test/TestStartupCache.cpp
@@ -414,17 +414,35 @@ int main(int argc, char** argv)
   nsCOMPtr<nsIFile> manifest;
   scrv = NS_GetSpecialDirectory(NS_GRE_DIR,
                                 getter_AddRefs(manifest));
   if (NS_FAILED(scrv)) {
     fail("NS_XPCOM_CURRENT_PROCESS_DIR");
     return 1;
   }
 
-  manifest->AppendNative(NS_LITERAL_CSTRING("TestStartupCacheTelemetry.manifest"));
+#ifdef XP_MACOSX
+  nsCOMPtr<nsIFile> tempManifest;
+  manifest->Clone(getter_AddRefs(tempManifest));
+  manifest->AppendNative(
+    NS_LITERAL_CSTRING("TestStartupCacheTelemetry.manifest"));
+  bool exists;
+  manifest->Exists(&exists);
+  if (!exists) {
+    // Workaround for bug 1080338 in mozharness.
+    manifest = tempManifest.forget();
+    manifest->SetNativeLeafName(NS_LITERAL_CSTRING("MacOS"));
+    manifest->AppendNative(
+      NS_LITERAL_CSTRING("TestStartupCacheTelemetry.manifest"));
+  }
+#else
+  manifest->AppendNative(
+    NS_LITERAL_CSTRING("TestStartupCacheTelemetry.manifest"));
+#endif
+
   XRE_AddManifestLocation(NS_COMPONENT_LOCATION, manifest);
 
   nsCOMPtr<nsIObserver> telemetryThing =
     do_GetService("@mozilla.org/testing/startup-cache-telemetry.js");
   if (!telemetryThing) {
     fail("telemetryThing");
     return 1;
   }