Bug 1185171 - Modify gmp-test-output-protection.h to prevent failure on machines without a physical monitor attached. r=bobowen
authorChris Manchester <cmanchester@mozilla.com>
Sat, 08 Aug 2015 22:08:09 -0700
changeset 257745 84e68150485c1a7d9043dee3d82ca5df33b5e78c
parent 257744 a0ab71814ee94ab9d872fdb8a7ef0fe3e31a23ad
child 257746 914e5f9795c9b8a0ec8ffd4e6546f95336ece704
push id29226
push userryanvm@gmail.com
push dateFri, 14 Aug 2015 13:01:14 +0000
treeherdermozilla-central@1b2402247429 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbobowen
bugs1185171
milestone43.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 1185171 - Modify gmp-test-output-protection.h to prevent failure on machines without a physical monitor attached. r=bobowen
dom/media/gmp-plugin/gmp-test-output-protection.h
--- a/dom/media/gmp-plugin/gmp-test-output-protection.h
+++ b/dom/media/gmp-plugin/gmp-test-output-protection.h
@@ -30,38 +30,38 @@ static BOOL CALLBACK EnumDisplayMonitors
 
   MONITORINFOEXA miex;
   ZeroMemory(&miex, sizeof(miex));
   miex.cbSize = sizeof(miex);
   if (!GetMonitorInfoA(hMonitor, &miex)) {
     failureMsgs->push_back("FAIL GetMonitorInfoA call failed");
   }
 
-  DISPLAY_DEVICEA dd;
-  ZeroMemory(&dd, sizeof(dd));
-  dd.cb = sizeof(dd);
-  if (!EnumDisplayDevicesA(miex.szDevice, 0, &dd, 1)) {
-    failureMsgs->push_back("FAIL EnumDisplayDevicesA call failed");
-  }
-
   ULONG numVideoOutputs = 0;
   IOPMVideoOutput** opmVideoOutputArray = nullptr;
   HRESULT hr = sOPMGetVideoOutputsFromHMONITORProc(hMonitor,
                                                    OPM_VOS_OPM_SEMANTICS,
                                                    &numVideoOutputs,
                                                    &opmVideoOutputArray);
   if (S_OK != hr) {
     if (0x8007001f != hr && 0x80070032 != hr && 0xc02625e5 != hr) {
       char msg[100];
       sprintf(msg, "FAIL OPMGetVideoOutputsFromHMONITOR call failed: HRESULT=0x%08x", hr);
       failureMsgs->push_back(msg);
     }
     return true;
   }
 
+  DISPLAY_DEVICEA dd;
+  ZeroMemory(&dd, sizeof(dd));
+  dd.cb = sizeof(dd);
+  if (!EnumDisplayDevicesA(miex.szDevice, 0, &dd, 1)) {
+    failureMsgs->push_back("FAIL EnumDisplayDevicesA call failed");
+  }
+
   for (ULONG i = 0; i < numVideoOutputs; ++i) {
     OPM_RANDOM_NUMBER opmRandomNumber;
     BYTE* certificate = nullptr;
     ULONG certificateLength = 0;
     hr = opmVideoOutputArray[i]->StartInitialization(&opmRandomNumber,
                                                      &certificate,
                                                      &certificateLength);
     if (S_OK != hr) {