Backed out 2 changesets (bug 911346)
authorWes Kocher <wkocher@mozilla.com>
Thu, 19 Sep 2013 18:27:33 -0700
changeset 161838 28edd4a1bbaaad1be49433f52a0185d868206fc2
parent 161837 9d5728797e772db19442ea21a32584fcad05c844
child 161839 a3255cb88e5ec309b251818f41a995d471515a50
push id3066
push userakeybl@mozilla.com
push dateMon, 09 Dec 2013 19:58:46 +0000
treeherdermozilla-beta@a31a0dce83aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs911346
milestone27.0a1
backs out6255c31609beaa57692332a9a3d233fa6f2d0fc3
cae77be484b9e96ed49cb47bd8bc9ba34cbd8d3e
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
Backed out 2 changesets (bug 911346) Backed out changeset 6255c31609be (bug 911346) Backed out changeset cae77be484b9 (bug 911346)
content/canvas/test/webgl/non-conf-tests/Makefile.in
content/canvas/test/webgl/non-conf-tests/driver-info.js
content/canvas/test/webgl/non-conf-tests/test_webgl_available.html
content/canvas/test/webgl/non-conf-tests/test_webgl_conformance.html
content/canvas/test/webgl/non-conf-tests/webgl-util.js
--- a/content/canvas/test/webgl/non-conf-tests/Makefile.in
+++ b/content/canvas/test/webgl/non-conf-tests/Makefile.in
@@ -1,13 +1,9 @@
 #
 # 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/.
 
 MOCHITEST_FILES = \
-  driver-info.js \
-  webgl-util.js \
-  \
-  test_webgl_available.html \
   test_webgl_conformance.html \
   test_webgl_request_mismatch.html \
   $(NULL)
deleted file mode 100644
--- a/content/canvas/test/webgl/non-conf-tests/driver-info.js
+++ /dev/null
@@ -1,125 +0,0 @@
-DriverInfo = (function() {
-  // ---------------------------------------------------------------------------
-  // Debug info handling
-
-  function defaultInfoFunc(str) {
-    console.log('Info: ' + str);
-  }
-
-  var gInfoFunc = defaultInfoFunc;
-  function setInfoFunc(func) {
-    gInfoFunc = func;
-  }
-
-  function info(str) {
-    gInfoFunc(str);
-  }
-
-  // ---------------------------------------------------------------------------
-  // OS and driver identification
-  //   Stolen from content/canvas/test/webgl/test_webgl_conformance_test_suite.html
-  function detectDriverInfo() {
-    const Cc = SpecialPowers.Cc;
-    const Ci = SpecialPowers.Ci;
-    var doc = Cc["@mozilla.org/xmlextras/domparser;1"].createInstance(Ci.nsIDOMParser).parseFromString("<html/>", "text/html");
-
-    var canvas = doc.createElement("canvas");
-    canvas.width = 1;
-    canvas.height = 1;
-
-    var type = "";
-    var gl;
-    try {
-      gl = canvas.getContext("experimental-webgl");
-    } catch(e) {
-      ok(false, "Failed to create a WebGL context for getting driver info.");
-      return ["", ""]
-    }
-    var ext = gl.getExtension("WEBGL_debug_renderer_info");
-    // this extension is unconditionally available to chrome. No need to check.
-
-    var webglRenderer = gl.getParameter(ext.UNMASKED_RENDERER_WEBGL);
-    var webglVendor = gl.getParameter(ext.UNMASKED_VENDOR_WEBGL);
-    return [webglVendor, webglRenderer];
-  }
-
-  var OS = {
-    WINDOWS: 'windows',
-    MAC: 'mac',
-    LINUX: 'linux',
-    ANDROID: 'android',
-  };
-
-  var DRIVER = {
-    MESA: 'mesa',
-    NVIDIA: 'nvidia',
-    ANDROID_X86_EMULATOR: 'android x86 emulator',
-  };
-
-  var kOS = null;
-  var kOSVersion = null;
-  var kDriver = null;
-
-  if (navigator.platform.indexOf('Win') == 0) {
-    kOS = OS.WINDOWS;
-
-    // code borrowed from browser/modules/test/browser_taskbar_preview.js
-    var version = SpecialPowers.Services.sysinfo.getProperty('version');
-    kOSVersion = parseFloat(version);
-    // Version 6.0 is Vista, 6.1 is 7.
-
-  } else if (navigator.platform.indexOf('Mac') == 0) {
-    kOS = OS.MAC;
-
-    var versionMatch = /Mac OS X (\d+.\d+)/.exec(navigator.userAgent);
-    kOSVersion = versionMatch ? parseFloat(versionMatch[1]) : null;
-
-  } else if (navigator.appVersion.indexOf('Android') != -1) {
-    kOS = OS.ANDROID;
-    // From layout/tools/reftest/reftest.js:
-    kOSVersion = SpecialPowers.Services.sysinfo.getProperty('version');
-
-  } else if (navigator.platform.indexOf('Linux') == 0) {
-    // Must be checked after android, as android also has a 'Linux' platform string.
-    kOS = OS.LINUX;
-  }
-
-  var glVendor, glRenderer;
-  [glVendor, glRenderer] = detectDriverInfo();
-  info('GL vendor: ' + glVendor);
-  info('GL renderer: ' + glRenderer);
-
-  if (glRenderer.contains('llvmpipe')) {
-    kDriver = DRIVER.MESA;
-  } else if (glRenderer.contains('Android Emulator')) {
-    kGLDriver = DRIVER.ANDROID_X86_EMULATOR;
-  } else if (glVendor.contains('NVIDIA')) {
-    kDriver = DRIVER.NVIDIA;
-  }
-
-  if (kOS) {
-    info('OS detected as: ' + kOS);
-    info('  Version: ' + kOSVersion);
-  } else {
-    info('OS not detected.');
-    info('  `platform`:   ' + navigator.platform);
-    info('  `appVersion`: ' + navigator.appVersion);
-    info('  `userAgent`:  ' + navigator.userAgent);
-  }
-  if (kDriver) {
-    info('GL driver detected as: ' + kDriver);
-  } else {
-    info('GL driver not detected.');
-  }
-
-  return {
-    setInfoFunc: setInfoFunc,
-
-    OS: OS,
-    DRIVER: DRIVER,
-    getOS: function() { return kOS; },
-    getDriver: function() { return kDriver; },
-    getOSVersion: function() { return kOSVersion; },
-  };
-})();
-
deleted file mode 100644
--- a/content/canvas/test/webgl/non-conf-tests/test_webgl_available.html
+++ /dev/null
@@ -1,37 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-<title>WebGL test: Check that WebGL works (or not) if it should (or should not).</title>
-<script src="/MochiKit/MochiKit.js"></script>
-<script src="/tests/SimpleTest/SimpleTest.js"></script>
-<link rel="stylesheet" href="/tests/SimpleTest/test.css">
-<script src="webgl-util.js"></script>
-<script src="driver-info.js"></script>
-</head>
-<body>
-<canvas id="c"></canvas>
-<script>
-
-var shouldSucceed = true;
-var shouldFail = false;
-
-if (DriverInfo.getOS() == DriverInfo.OS.ANDROID &&
-    DriverInfo.getOSVersion() < 15)
-{
-  // Consider 'random'. Actually, ARMv6 fails, and ARMv7 succeeds, but we have
-  // not been successful at determining this from JS. (see bug 917478)
-  shouldSucceed = false;
-  shouldFail = false;
-}
-
-var gl = WebGLUtil.getWebGL('c');
-if (shouldSucceed) {
-  ok(gl, 'Expected WebGL creation to succeed.');
-}
-if (shouldFail) {
-  ok(!gl, 'Expected WebGL creation to fail.');
-}
-
-</script>
-</body>
-</html>
--- a/content/canvas/test/webgl/non-conf-tests/test_webgl_conformance.html
+++ b/content/canvas/test/webgl/non-conf-tests/test_webgl_conformance.html
@@ -1,30 +1,26 @@
 <!DOCTYPE HTML>
-<html>
-<head>
 <title>WebGL test: 'webgl' context request</title>
 <script src="/MochiKit/MochiKit.js"></script>
 <script src="/tests/SimpleTest/SimpleTest.js"></script>
 <link rel="stylesheet" href="/tests/SimpleTest/test.css">
-<script src="webgl-util.js"></script>
-</head>
 <body>
 <canvas id="c"></canvas>
 <script>
 
-var gl = WebGLUtil.getWebGL('c', true);
+var canvas = document.getElementById('c');
+var gl = canvas.getContext('webgl');
 
 var isMobile = /Mobile/.test(navigator.userAgent);
 var isTablet = /Tablet/.test(navigator.userAgent);
 var shouldBeConformant = !isMobile && !isTablet;
 
 if (shouldBeConformant) {
   // Desktop.
   ok(gl, 'Expected conformance on: ' + navigator.userAgent);
 } else {
   // Fennec, B2G.
   ok(!gl, 'Expected no conformance on: ' + navigator.userAgent);
 }
 
 </script>
-</body>
-</html>
+
deleted file mode 100644
--- a/content/canvas/test/webgl/non-conf-tests/webgl-util.js
+++ /dev/null
@@ -1,114 +0,0 @@
-WebGLUtil = (function() {
-  // ---------------------------------------------------------------------------
-  // Error handling
-
-  function defaultErrorFunc(str) {
-    console.log('Error: ' + str);
-  }
-
-  var gErrorFunc = defaultErrorFunc;
-  function setErrorFunc(func) {
-    gErrorFunc = func;
-  }
-
-  function error(str) {
-    gErrorFunc(str);
-  }
-
-  // ---------------------------------------------------------------------------
-  // WebGL helpers
-
-  function getWebGL(canvasId, requireConformant) {
-    // `requireConformant` will default to falsey if it is not supplied.
-
-    var canvas = document.getElementById(canvasId);
-
-    var gl = null;
-    try {
-      gl = canvas.getContext('webgl');
-    } catch(e) {}
-
-    if (!gl && !requireConformant) {
-      try {
-        gl = canvas.getContext('experimental-webgl');
-      } catch(e) {}
-    }
-
-    if (!gl) {
-      error('WebGL context could not be retrieved from \'' + canvasId + '\'.');
-      return null;
-    }
-
-    return gl;
-  }
-
-  function getContentFromElem(elem) {
-    var str = "";
-    var k = elem.firstChild;
-    while (k) {
-      if (k.nodeType == 3)
-        str += k.textContent;
-
-      k = k.nextSibling;
-    }
-
-    return str;
-  }
-
-  // Returns a valid shader, or null on errors.
-  function createShaderById(gl, id) {
-    var elem = document.getElementById(id);
-    if (!elem) {
-      error('Failed to create shader from non-existent id \'' + id + '\'.');
-      return null;
-    }
-
-    var src = getContentById(id);
-
-    var shader;
-    if (elem.type == "x-shader/x-fragment") {
-      shader = gl.createShader(gl.FRAGMENT_SHADER);
-    } else if (shaderScript.type == "x-shader/x-vertex") {
-      shader = gl.createShader(gl.VERTEX_SHADER);
-    } else {
-      error('Bad MIME type for shader \'' + id + '\': ' + elem.type + '.');
-      return null;
-    }
-
-    gl.shaderSource(shader, str);
-    gl.compileShader(shader);
-
-    return shader;
-  }
-
-  function createProgramByIds(gl, vsId, fsId) {
-    var vs = createShaderById(gl, vsId);
-    var fs = createShaderById(gl, fsId);
-    if (!vs || !fs)
-      return null;
-
-    var prog = gl.createProgram();
-    gl.attachShader(prog, vs);
-    gl.attachShader(prog, fs);
-    gl.linkProgram(prog);
-
-    if (!gl.getProgramParameter(prog, gl.LINK_STATUS)) {
-      var str = "Shader program linking failed:\n";
-      str += "Shader program info log:\n" + gl.getProgramInfoLog(prog) + "\n\n";
-      str += "Vert shader log:\n" + gl.getShaderInfoLog(vs) + "\n\n";
-      str += "Frag shader log:\n" + gl.getShaderInfoLog(fs);
-      error(str);
-      return null;
-    }
-
-    return prog;
-  }
-
-  return {
-    setErrorFunc: setErrorFunc,
-
-    getWebGL: getWebGL,
-    createShaderById: createShaderById,
-    createProgramByIds: createProgramByIds,
-  };
-})();