Backing out 82a7ea7ce995 as it hasn't had the appropriate reviews for landing.
authorDave Townsend <dtownsend@oxymoronical.com>
Tue, 26 May 2015 21:57:05 -0700
changeset 268016 5a6a4ced599be299eac0440bfbf4154c0749a836
parent 268015 c7b2ecf508e62436f0c12ac4950b9b3caaf5056f
child 268017 14f0933c537c26fb26050fb952fdd94c48756969
push id2294
push userbsmedberg@mozilla.com
push dateWed, 27 May 2015 15:05:10 +0000
milestone41.0a1
Backing out 82a7ea7ce995 as it hasn't had the appropriate reviews for landing.
browser/app/profile/extensions/Makefile.in
browser/app/profile/extensions/moz.build
browser/app/profile/extensions/sanity-gfx@mozilla.org/bootstrap.js
browser/app/profile/extensions/sanity-gfx@mozilla.org/chrome.manifest
browser/app/profile/extensions/sanity-gfx@mozilla.org/content/chrome/sanitytest.html
browser/app/profile/extensions/sanity-gfx@mozilla.org/content/chrome/videotest.mp4
browser/app/profile/extensions/sanity-gfx@mozilla.org/install.rdf.in
browser/app/profile/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/moz.build
deleted file mode 100644
--- a/browser/app/profile/extensions/Makefile.in
+++ /dev/null
@@ -1,42 +0,0 @@
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/:
-
-
-DISTROEXT = $(abspath $(FINAL_TARGET))/distribution/extensions
-
-include $(topsrcdir)/config/config.mk
-
-ifeq (windows,$(MOZ_WIDGET_TOOLKIT))
-EXTENSIONS = \
-	sanity-gfx@mozilla.org \
-	$(NULL)
-
-all_xpis = $(foreach dir,$(EXTENSIONS),$(DISTROEXT)/$(dir).xpi)
-libs:: $(all_xpis)
-GARBAGE += $(all_xpis)
-
-define pp_one
-$(2) := $(2)
-$(2)_PATH := $(dir $(2))
-$(2)_TARGET := libs-$(1)
-PP_TARGETS += $(2)
-endef
-$(foreach d,$(EXTENSIONS), \
-	$(foreach in,$(shell cd $(srcdir) ; find $(d) -name '*.in'), \
-		$(eval $(call pp_one,$(d),$(in))) \
-	) \
-)
-
-endif
-
-include $(topsrcdir)/config/rules.mk
-
-$(all_xpis): $(DISTROEXT)/%.xpi: $(call mkdir_deps,$(DISTROEXT)) libs-%
-	cd $* && \
-	$(ZIP) -r9XD $@ * -x \*.in -x \*.mkdir.done
-	cd $(abspath $(srcdir)/$*) && \
-	$(ZIP) -r9XD $@ * -x \*.in -x \*.mkdir.done
-
-.PHONY: $(all_xpis:.xpi=)
--- a/browser/app/profile/extensions/moz.build
+++ b/browser/app/profile/extensions/moz.build
@@ -1,9 +1,7 @@
 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 DIRS += ['{972ce4c6-7e08-4474-a285-3208198ce6fd}']
-
-DIST_SUBDIR = ''
deleted file mode 100755
--- a/browser/app/profile/extensions/sanity-gfx@mozilla.org/bootstrap.js
+++ /dev/null
@@ -1,148 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
-Cu.import('resource://gre/modules/Services.jsm');
-Cu.import('resource://gre/modules/Preferences.jsm');
-
-const PAGE_WIDTH=72;
-const PAGE_HEIGHT=136;
-const DRIVER_PREF="sanity-test.driver-version";
-const DEVICE_PREF="sanity-test.device-id";
-const VERSION_PREF="sanity-test.version";
-const DISABLE_VIDEO_PREF="media.hardware-video-decoding.failed";
-const RUNNING_PREF="sanity-test.running";
-
-// GRAPHICS_SANITY_TEST histogram enumeration values
-const TEST_PASSED=0;
-const TEST_FAILED_RENDER=1;
-const TEST_FAILED_VIDEO=2;
-const TEST_CRASHED=3;
-
-function install() {}
-function uninstall() {}
-
-function testPixel(ctx, x, y, r, g, b, a, fuzz) {
-  var data = ctx.getImageData(x, y, 1, 1);
-
-  if (Math.abs(data.data[0] - r) <= fuzz &&
-      Math.abs(data.data[1] - g) <= fuzz &&
-      Math.abs(data.data[2] - b) <= fuzz &&
-      Math.abs(data.data[3] - a) <= fuzz) {
-    return true;
-  }
-
-  return false;
-}
-
-// Verify that all the 4 coloured squares of the video
-// render as expected (with a tolerance of 5 to allow for
-// yuv->rgb differences between platforms).
-//
-// The video is 64x64, and is split into quadrants of
-// different colours. The top left of the video is 8,72
-// and we test a pixel 10,10 into each quadrant to avoid
-// blending differences at the edges.
-//
-// We allow massive amounts of fuzz for the colours since
-// it can depend hugely on the yuv -> rgb conversion, and
-// we don't want to fail unnecessarily.
-function testVideoRendering(ctx) {
-  return testPixel(ctx, 18, 82, 255, 255, 255, 255, 64) &&
-         testPixel(ctx, 50, 82, 0, 255, 0, 255, 64) &&
-         testPixel(ctx, 18, 114, 0, 0, 255, 255, 64) &&
-         testPixel(ctx, 50, 114, 255, 0, 0, 255, 64);
-}
-
-function hasHardwareLayers(win) {
-  var winUtils = win.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils);
-  if (winUtils.layerManagerType != "Basic") {
-    return true;
-  }
-  return false;
-}
-
-function reportResult(val) {
-  try {
-    let histogram = Services.telemetry.getHistogramById("GRAPHICS_SANITY_TEST");
-    histogram.add(val);
-  } catch (e) {}
-
-  Preferences.set(RUNNING_PREF, false);
-  Services.prefs.savePrefFile(null);
-}
-
-function windowLoaded(event) {
-  var win = event.target;
-
-  // Take a snapshot of the window contents, and then close the window
-  var canvas = win.createElementNS("http://www.w3.org/1999/xhtml", "canvas");
-  canvas.setAttribute("width", PAGE_WIDTH);
-  canvas.setAttribute("height", PAGE_HEIGHT);
-
-  // TODO: drawWindow reads back from the gpu's backbuffer, which won't catch issues with presenting
-  // the front buffer via the window manager. Ideally we'd use an OS level API for reading back
-  // from the desktop itself to get a more accurate test.
-  var ctx = canvas.getContext("2d");
-  var flags = ctx.DRAWWINDOW_DRAW_CARET | ctx.DRAWWINDOW_DRAW_VIEW | ctx.DRAWWINDOW_USE_WIDGET_LAYERS;
-  ctx.drawWindow(win.ownerGlobal, 0, 0, PAGE_WIDTH, PAGE_HEIGHT, "rgb(255,255,255)", flags);
-
-  win.ownerGlobal.close();
-
-  // Verify that the snapshot contains the expected contents. If it doesn't, then
-  // try disabling gfx features and restart the browser.
-
-  // TODO: When Bug 1151611 lands we can test hardware video decoding status
-  // directly instead of checking the pref.
-  if (!testVideoRendering(ctx)) {
-    reportResult(TEST_FAILED_VIDEO);
-    if (Preferences.get("layers.hardware-video-decoding.enabled", false)) {
-      Preferences.set(DISABLE_VIDEO_PREF, true);
-    }
-    return;
-  }
-
-  reportResult(TEST_PASSED);
-}
-
-function startup(data, reason) {
-  // Only test gfx features if firefox has updated, or if the user has a new
-  // gpu or drivers.
-  var gfxinfo = Cc["@mozilla.org/gfx/info;1"].getService(Ci.nsIGfxInfo);
-
-  // If the running pref is still true then we must have crashed before
-  // finishing the test. Report this and don't try running again.
-  if (Preferences.get(RUNNING_PREF, false)) {
-    reportResult(TEST_CRASHED);
-    return;
-  }
-
-  // TODO: Handle dual GPU setups
-  if (Preferences.get(DRIVER_PREF, "") == gfxinfo.adapterDriver &&
-      Preferences.get(DEVICE_PREF, "") == gfxinfo.adapterDeviceID &&
-      Preferences.get(VERSION_PREF, "") == data.version) {
-    return;
-  }
-
-  // Update the prefs so that this test doesn't run again until the next update.
-  Preferences.set(DRIVER_PREF, gfxinfo.adapterDriver);
-  Preferences.set(DEVICE_PREF, gfxinfo.adapterDeviceID);
-  Preferences.set(VERSION_PREF, data.version);
-  Preferences.set(RUNNING_PREF, true);
-  Services.prefs.savePrefFile(null);
-
-  // Remove any previously set failure data. These should be live prefs that
-  // will take effect for the window we're about to open.
-  Preferences.set(DISABLE_VIDEO_PREF, false);
-
-  // Open a tiny window to render our test page, and notify us when it's loaded
-  var win = Services.ww.openWindow(null,
-                                   "chrome://sanity-test/content/sanitytest.html",
-                                   "Test Page",
-                                   "width=" + PAGE_WIDTH + ",height=" + PAGE_HEIGHT + ",chrome,titlebar=0,scrollbars=0",
-                                   null);
-  win.onload = windowLoaded;
-}
-
-function shutdown() {}
deleted file mode 100755
--- a/browser/app/profile/extensions/sanity-gfx@mozilla.org/chrome.manifest
+++ /dev/null
@@ -1,1 +0,0 @@
-content sanity-test content/chrome/
deleted file mode 100644
--- a/browser/app/profile/extensions/sanity-gfx@mozilla.org/content/chrome/sanitytest.html
+++ /dev/null
@@ -1,6 +0,0 @@
-<html>
-    <body>
-        <div style="width:64px; height:64px; background-color:red;"></div>
-        <video src="videotest.mp4"></video>
-    </body>
-</html>
deleted file mode 100644
index 42cf6e1aa6dfc6260ec535813bc753c3724f96e9..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100755
--- a/browser/app/profile/extensions/sanity-gfx@mozilla.org/install.rdf.in
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-	<!-- This Source Code Form is subject to the terms of the Mozilla Public
-   - License, v. 2.0. If a copy of the MPL was not distributed with this
-   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-#filter substitution
-
-	<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-	  <Description about="urn:mozilla:install-manifest">
-		<em:id>sanity-gfx@mozilla.org</em:id>
-		<em:version>@FIREFOX_VERSION@</em:version>
-		<em:type>2</em:type>
-		<em:bootstrap>true</em:bootstrap>
-		<em:unpack>false</em:unpack>
-
-		<!-- Firefox -->
-		<em:targetApplication>
-		  <Description>
-			<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
-			<em:minVersion>@FIREFOX_VERSION@</em:minVersion>
-			<em:maxVersion>@FIREFOX_VERSION@</em:maxVersion>
-		  </Description>
-		</em:targetApplication>
-
-		<!-- Front End MetaData -->
-		<em:name>Firefox Gfx Sanity Test</em:name>
-		<em:description>Does basic testing for firefox graphics features, and disables them if they don't work correctly </em:description>
-		<em:creator>Mozilla</em:creator>
-	  </Description>
-	</RDF>
--- a/browser/app/profile/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/moz.build
+++ b/browser/app/profile/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/moz.build
@@ -1,7 +1,6 @@
 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-DIST_SUBDIR = 'browser'