Bug 879085 - Ignore return result for CoAllowSetForegroundWindow call in the metro test harness, solves some startup problems for QA MozMill testing on vms. r=bbondy
authorJim Mathies <jmathies@mozilla.com>
Thu, 06 Jun 2013 07:16:36 -0500
changeset 134238 e7d7d70be1022054edbf43253fc8c995e1d4d3d3
parent 134237 e6b129e4eebcbb9fdb23f1104c755a60d189bca7
child 134239 0e1e811ba78db4b20ce759b1030c6564b25a99b0
push id29111
push userryanvm@gmail.com
push dateThu, 06 Jun 2013 14:05:53 +0000
treeherdermozilla-inbound@e7d7d70be102 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbbondy
bugs879085
milestone24.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 879085 - Ignore return result for CoAllowSetForegroundWindow call in the metro test harness, solves some startup problems for QA MozMill testing on vms. r=bbondy
browser/metro/shell/testing/metrotestharness.cpp
--- a/browser/metro/shell/testing/metrotestharness.cpp
+++ b/browser/metro/shell/testing/metrotestharness.cpp
@@ -213,22 +213,21 @@ static bool Launch()
     Fail(L"GetDefaultBrowserAppModelID failed.");
     return false;
   }
   Log(L"App model id='%s'", appModelID);
 
   // Hand off focus rights if the terminal has focus to the out-of-process
   // activation server (explorer.exe). Without this the metro interface
   // won't launch.
-  if (GetForegroundWindow() == GetConsoleWindow()) {
-    hr = CoAllowSetForegroundWindow(activateMgr, NULL);
-    if (FAILED(hr)) {
-      Fail(L"CoAllowSetForegroundWindow result %X", hr);
-      return false;
-    }
+  hr = CoAllowSetForegroundWindow(activateMgr, NULL);
+  if (FAILED(hr)) {
+    // Log but don't fail. This has happened on vms with certain terminals run by
+    // QA during mozmill testing.
+    Log(L"Windows focus rights hand off failed (HRESULT=0x%X). Ignoring.", hr);
   }
 
   Log(L"Harness process id: %d", GetCurrentProcessId());
 
   // If provided, validate the firefox path passed in.
   int binLen = wcslen(kFirefoxExe);
   if (sFirefoxPath.GetLength() && sFirefoxPath.Right(binLen) != kFirefoxExe) {
     Log(L"firefoxpath is missing a valid bin name! Assuming '%s'.", kFirefoxExe);