Bug 1077282: Work around the fact that mozharness is not yet aware of the new GreD on OSX (
bug 1080338). r=bsmedberg
--- 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;
}