Bug 844275 - Update test_acceleration to guard against windows with no layer manager. r=joedrew
authorKartikaya Gupta <kgupta@mozilla.com>
Thu, 28 Feb 2013 13:28:24 -0500
changeset 133769 0d76808a48e997bd5b50fb70473f2bf94b1dedf8
parent 133768 c1bcca41d5518164f3e756a9f740b8ec8b78e904
child 133770 eadd24d27a6179af714d175d0c52ec10f26fa36b
push id2452
push userlsblakk@mozilla.com
push dateMon, 13 May 2013 16:59:38 +0000
treeherdermozilla-beta@d4b152d29d8d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjoedrew
bugs844275
milestone22.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 844275 - Update test_acceleration to guard against windows with no layer manager. r=joedrew
gfx/tests/mochitest/test_acceleration.html
--- a/gfx/tests/mochitest/test_acceleration.html
+++ b/gfx/tests/mochitest/test_acceleration.html
@@ -28,18 +28,23 @@ var Ci = SpecialPowers.Ci;
 var sysInfo = Cc["@mozilla.org/system-info;1"].getService(Ci.nsIPropertyBag2);
 
 var windows = SpecialPowers.Services.ww.getWindowEnumerator();
 var windowutils;
 var acceleratedWindows = 0;
 while (windows.hasMoreElements()) {
   windowutils = windows.getNext().QueryInterface(Ci.nsIInterfaceRequestor)
                                  .getInterface(Ci.nsIDOMWindowUtils);
-  if (windowutils.layerManagerType != "Basic") {
-    acceleratedWindows++;
+  try {
+    if (windowutils.layerManagerType != "Basic") {
+      acceleratedWindows++;
+    }
+  } catch (e) {
+    // The window may not have a layer manager, in which case we get an error.
+    // Don't count it as an accelerated window.
   }
 }
 
 var osName = sysInfo.getProperty("name");
 switch(osName)
 {
   case "Darwin": // Mac OS X.
     // We only enable OpenGL layers on machines that don't support QuickDraw