Bug 1193526 - Update all generator files for webgl conformance test 1.0.3. r=jgilbert draft
authorMorris Tseng <mtseng@mozilla.com>
Fri, 22 Apr 2016 14:48:20 +0800
changeset 355247 1198833e24f9ab1997639f227ff62eedb6c04802
parent 355246 383407d2fd89a13e1b50c74adfa20519804091bf
child 355248 74b9e26320dfe4e1dae04657fc7e0c290c8340ba
push id16244
push usermtseng@mozilla.com
push dateFri, 22 Apr 2016 06:52:05 +0000
reviewersjgilbert
bugs1193526
milestone48.0a1
Bug 1193526 - Update all generator files for webgl conformance test 1.0.3. r=jgilbert MozReview-Commit-ID: 4i332ia5NRs
dom/canvas/test/webgl-conf/always-fail.html
dom/canvas/test/webgl-conf/generate-wrappers-and-manifest.py
dom/canvas/test/webgl-conf/iframe-passthrough.css
dom/canvas/test/webgl-conf/mochi-single.html
dom/canvas/test/webgl-conf/mochi-wrapper.html.template
dom/canvas/test/webgl-conf/mochitest.ini.template
--- a/dom/canvas/test/webgl-conf/always-fail.html
+++ b/dom/canvas/test/webgl-conf/always-fail.html
@@ -1,15 +1,14 @@
 <!DOCTYPE html>
-<meta charset='utf-8'>
 <html>
 <head>
-    <title>Always fail test</title>
-    <link rel='stylesheet' href='resources/js-test-style.css'/>
-    <script src='resources/js-test-pre.js'></script>
+  <meta charset='utf-8'>
+  <link rel='stylesheet' href='checkout/resources/js-test-style.css'/>
+  <script src='checkout/resources/js-test-pre.js'></script>
 </head>
 <body>
   <div id='description'></div>
   <div id='console'></div>
 
   <script>
     description('Deliberately fail so as to test our harness.');
 
--- a/dom/canvas/test/webgl-conf/generate-wrappers-and-manifest.py
+++ b/dom/canvas/test/webgl-conf/generate-wrappers-and-manifest.py
@@ -4,98 +4,150 @@
 # 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/.
 #
 # Write a Mochitest manifest for WebGL conformance test files.
 
 import os
 import re
 
-WRAPPER_TEMPLATE_FILEPATH = 'mochi-wrapper.html.template'
-WRAPPERS_DIR = '_wrappers'
-MANIFEST_TEMPLATE_FILEPATH = 'mochitest.ini.template'
-MANIFEST_OUTPUT_FILEPATH = '../_webgl-conformance.ini'
-ERRATA_FILEPATH = 'mochitest-errata.ini'
-BASE_TEST_LIST_FILENAME = '00_test_list.txt'
-FILE_PATH_PREFIX = os.path.basename(os.getcwd()) # 'webgl-conformance'
+CURRENT_VERSION = '1.0.3'
+
+# All paths in this file are based where this file is run.
+WRAPPER_TEMPLATE_FILE = 'mochi-wrapper.html.template'
+MANIFEST_TEMPLATE_FILE = 'mochitest.ini.template'
+ERRATA_FILE = 'mochitest-errata.ini'
+DEST_MANIFEST_PATHSTR = 'generated-mochitest.ini'
+
+BASE_TEST_LIST_PATHSTR = 'checkout/00_test_list.txt'
+GENERATED_PATHSTR = 'generated'
 
 SUPPORT_DIRS = [
-    'conformance',
-    'resources',
+    'checkout/conformance',
+    'checkout/resources',
 ]
 
 EXTRA_SUPPORT_FILES = [
     'always-fail.html',
-    'iframe-autoresize.js',
+    'iframe-passthrough.css',
     'mochi-single.html',
-    '../webgl-mochitest/driver-info.js',
 ]
 
 ACCEPTABLE_ERRATA_KEYS = set([
   'fail-if',
   'skip-if',
   'subsuite',
 ])
 
-GENERATED_HEADER = '''
-# This is a GENERATED FILE. Do not edit it directly.
-# Regenerated it by using `python generate-wrappers-and-manifest.py`.
-# Mark skipped tests in mochitest-errata.ini.
-# Mark failing tests in mochi-single.html.
-'''.strip()
-
 ########################################################################
 # GetTestList
 
 def GetTestList():
-    testList = []
-    AccumTests('', BASE_TEST_LIST_FILENAME, testList)
+    split = BASE_TEST_LIST_PATHSTR.rsplit('/', 1)
+    basePath = '.'
+    testListFile = split[-1]
+    if len(split) == 2:
+        basePath = split[0]
+
+    curVersion = CURRENT_VERSION
+    testList = ['always-fail.html']
+    AccumTests(basePath, testListFile, curVersion, testList)
+
+    testList = [os.path.relpath(x, basePath).replace(os.sep, '/') for x in testList]
     return testList
 
 ##############################
 # Internals
 
-def AccumTests(path, listFile, out_testList):
-    listFilePath = os.path.join(path, listFile)
-    assert os.path.exists(listFilePath), 'Bad `listFilePath`: ' + listFilePath
+def IsVersionLess(a, b):
+    aSplit = [int(x) for x in a.split('.')]
+    bSplit = [int(x) for x in b.split('.')]
+
+    while len(aSplit) < len(bSplit):
+        aSplit.append(0)
+
+    while len(aSplit) > len(bSplit):
+        bSplit.append(0)
+
+    for i in range(len(aSplit)):
+        aVal = aSplit[i]
+        bVal = bSplit[i]
+
+        if aVal == bVal:
+            continue
 
-    with open(listFilePath, 'rb') as fIn:
+        return aVal < bVal
+
+    return False
+
+
+def AccumTests(pathStr, listFile, curVersion, out_testList):
+    listPathStr = pathStr + '/' + listFile
+
+    listPath = listPathStr.replace('/', os.sep)
+    assert os.path.exists(listPath), 'Bad `listPath`: ' + listPath
+
+    with open(listPath, 'rb') as fIn:
+        lineNum = 0
         for line in fIn:
+            lineNum += 1
+
             line = line.rstrip()
             if not line:
                 continue
 
-            strippedLine = line.lstrip()
-            if strippedLine.startswith('//'):
+            curLine = line.lstrip()
+            if curLine.startswith('//'):
                 continue
-            if strippedLine.startswith('#'):
-                continue
-            if strippedLine.startswith('--'):
+            if curLine.startswith('#'):
                 continue
 
-            split = line.rsplit('.', 1)
+            shouldSkip = False
+            while curLine.startswith('--'): # '--min-version 1.0.2 foo.html'
+                (flag, curLine) = curLine.split(' ', 1)
+                if flag == '--min-version':
+                    (refVersion, curLine) = curLine.split(' ', 1)
+                    if IsVersionLess(curVersion, refVersion):
+                        shouldSkip = True
+                        break
+                elif flag == '--max-version':
+                    (refVersion, curLine) = curLine.split(' ', 1)
+                    if IsVersionLess(refVersion, curVersion):
+                        shouldSkip = True
+                        break
+                elif flag == '--slow':
+                    continue # TODO
+                else:
+                    text = 'Unknown flag \'{}\': {}:{}: {}'.format(flag, listPath,
+                                                                   lineNum, line)
+                    assert False, text
+                continue
+
+            if shouldSkip:
+                continue
+
+            split = curLine.rsplit('.', 1)
             assert len(split) == 2, 'Bad split for `line`: ' + line
             (name, ext) = split
 
             if ext == 'html':
-                newTestFilePath = os.path.join(path, line)
-                newTestFilePath = newTestFilePath.replace(os.sep, '/')
-                out_testList.append(newTestFilePath)
+                newTestFilePathStr = pathStr + '/' + curLine
+                out_testList.append(newTestFilePathStr)
                 continue
 
             assert ext == 'txt', 'Bad `ext` on `line`: ' + line
 
-            split = line.rsplit('/', 1)
+            split = curLine.rsplit('/', 1)
             nextListFile = split[-1]
-            nextPath = ''
+            nextPathStr = ''
             if len(split) != 1:
-                nextPath = split[0]
+                nextPathStr = split[0]
 
-            nextPath = os.path.join(path, nextPath)
-            AccumTests(nextPath, nextListFile, out_testList)
+            nextPathStr = pathStr + '/' + nextPathStr
+            AccumTests(nextPathStr, nextListFile, curVersion, out_testList)
             continue
 
     return
 
 ########################################################################
 # Templates
 
 def FillTemplate(inFilePath, templateDict, outFilePath):
@@ -147,18 +199,17 @@ class TemplateShellSpan:
 
         return
 
 
     def Fill(self, templateDict, indentLen):
         if self.isLiteralSpan:
             return self.span
 
-        assert (self.span in templateDict,
-                '\'' + self.span + '\' not in dict!')
+        assert self.span in templateDict, '\'' + self.span + '\' not in dict!'
 
         filling = templateDict[self.span]
 
         return WrapWithIndent(filling, indentLen)
 
 
 class TemplateShell:
     def __init__(self, iterableLines):
@@ -215,153 +266,195 @@ class TemplateShell:
                 indentLen += len(span)
             continue
 
         return ret
 
 ########################################################################
 # Output
 
-def WriteWrappers(testWebPathList):
-    templateShell = ImportTemplate(WRAPPER_TEMPLATE_FILEPATH)
+def WriteWrappers(testWebPathStrList):
+    templateShell = ImportTemplate(WRAPPER_TEMPLATE_FILE)
 
-    if not os.path.exists(WRAPPERS_DIR):
-        os.mkdir(WRAPPERS_DIR)
-    assert os.path.isdir(WRAPPERS_DIR)
+    generatedDirPath = GENERATED_PATHSTR.replace('/', os.sep)
+    if not os.path.exists(generatedDirPath):
+        os.mkdir(generatedDirPath)
+    assert os.path.isdir(generatedDirPath)
 
-    wrapperManifestPathList = []
-    for testWebPath in testWebPathList:
+    wrapperManifestPathStrList = []
+    for testWebPathStr in testWebPathStrList:
         # Mochitests must start with 'test_' or similar, or the test
         # runner will ignore our tests.
         # The error text is "is not a valid test".
-        wrapperFilePath = 'test_' + testWebPath.replace('/', '__')
-        wrapperFilePath = os.path.join(WRAPPERS_DIR, wrapperFilePath)
+        wrapperFilePathStr = 'test_' + testWebPathStr.replace('/', '__')
+        wrapperFilePathStr = GENERATED_PATHSTR + '/' + wrapperFilePathStr
+        wrapperManifestPathStrList.append(wrapperFilePathStr)
 
         templateDict = {
-            'TEST_PATH': testWebPath,
+            'HEADER': '<!-- GENERATED FILE, DO NOT EDIT -->',
+            'TEST_PATH': testWebPathStr,
         }
 
-        print('Writing \'' + wrapperFilePath + '\'')
-        OutputFilledTemplate(templateShell, templateDict,
-                             wrapperFilePath)
-
-        wrapperManifestPath = wrapperFilePath.replace(os.sep, '/')
-        wrapperManifestPathList.append(wrapperManifestPath)
+        print 'Adding wrapper: ' + wrapperFilePathStr
+        OutputFilledTemplate(templateShell, templateDict, wrapperFilePathStr)
         continue
 
-    return wrapperManifestPathList
+    return wrapperManifestPathStrList
 
 
-def PathFromManifestDir(path):
-    print('path: ' + path)
-    ret = os.path.join(FILE_PATH_PREFIX, path)
-    return ret.replace(os.sep, '/')
+kManifestRelPathStr = os.path.relpath('.', os.path.dirname(DEST_MANIFEST_PATHSTR))
+kManifestRelPathStr = kManifestRelPathStr.replace(os.sep, '/')
+
+def ManifestPathStr(pathStr):
+    pathStr = kManifestRelPathStr + '/' + pathStr
+    return os.path.normpath(pathStr).replace(os.sep, '/')
 
 
-def WriteManifest(wrapperManifestPathList, supportFilePathList):
+def WriteManifest(wrapperPathStrList, supportPathStrList):
+    destPathStr = DEST_MANIFEST_PATHSTR
+    print 'Generating manifest: ' + destPathStr
+
     errataMap = LoadErrata()
 
     # DEFAULT_ERRATA
-    defaultHeader = '[DEFAULT]'
-    defaultErrataStr = ''
-    if defaultHeader in errataMap:
-        defaultErrataStr = '\n'.join(errataMap[defaultHeader])
-        del errataMap[defaultHeader]
+    defaultSectionName = 'DEFAULT'
+
+    defaultSectionLines = []
+    if defaultSectionName in errataMap:
+        defaultSectionLines = errataMap[defaultSectionName]
+        del errataMap[defaultSectionName]
+
+    defaultSectionStr = '\n'.join(defaultSectionLines)
 
     # SUPPORT_FILES
-    supportFilePathList = sorted(supportFilePathList)
-    supportFilePathList = [PathFromManifestDir(x) for x in supportFilePathList]
-    supportFilesStr = '\n'.join(supportFilePathList)
+    supportPathStrList = [ManifestPathStr(x) for x in supportPathStrList]
+    supportPathStrList = sorted(supportPathStrList)
+    supportFilesStr = '\n'.join(supportPathStrList)
 
     # MANIFEST_TESTS
     manifestTestLineList = []
-    for wrapperManifestPath in wrapperManifestPathList:
-        header = '[' + wrapperManifestPath + ']'
-        transformedHeader = '[' + PathFromManifestDir(wrapperManifestPath) + ']'
-        # header: '[foo.html]'
-        # transformedHeader: '[webgl-conformance/foo.html]'
+    wrapperPathStrList = sorted(wrapperPathStrList)
+    for wrapperPathStr in wrapperPathStrList:
+        #print 'wrapperPathStr: ' + wrapperPathStr
 
-        manifestTestLineList.append(transformedHeader)
+        wrapperManifestPathStr = ManifestPathStr(wrapperPathStr)
+        sectionName = '[' + wrapperManifestPathStr + ']'
+        manifestTestLineList.append(sectionName)
 
-        if not header in errataMap:
-            continue
+        if wrapperPathStr in errataMap:
+            manifestTestLineList += errataMap[wrapperPathStr]
+            del errataMap[wrapperPathStr]
 
-        errataLineList = errataMap[header]
-        del errataMap[header]
-        manifestTestLineList += errataLineList
         continue
 
-    assert not errataMap, 'Errata left in map: {}'.format(str(errataMap))
+    if errataMap:
+        print 'Errata left in map:'
+        for x in errataMap.keys():
+            print ' '*4 + x
+        assert False
 
     manifestTestsStr = '\n'.join(manifestTestLineList)
 
     # Fill the template.
     templateDict = {
-        'HEADER': GENERATED_HEADER,
-        'DEFAULT_ERRATA': defaultErrataStr,
+        'DEFAULT_ERRATA': defaultSectionStr,
         'SUPPORT_FILES': supportFilesStr,
         'MANIFEST_TESTS': manifestTestsStr,
     }
 
-    FillTemplate(MANIFEST_TEMPLATE_FILEPATH, templateDict,
-                 MANIFEST_OUTPUT_FILEPATH)
+    destPath = destPathStr.replace('/', os.sep)
+    FillTemplate(MANIFEST_TEMPLATE_FILE, templateDict, destPath)
     return
 
 ##############################
 # Internals
 
-kManifestHeaderRegex = re.compile(r'\[[^\]]*?\]')
+kManifestHeaderRegex = re.compile(r'[[]([^]]*)[]]')
+
+def LoadINI(path):
+    curSectionName = None
+    curSectionMap = {}
+
+    lineNum = 0
+
+    ret = {}
+    ret[curSectionName] = (lineNum, curSectionMap)
+
+    with open(path, 'rb') as f:
+        for line in f:
+            lineNum += 1
+
+            line = line.strip()
+            if not line:
+                continue
+
+            if line[0] in [';', '#']:
+                continue
+
+            if line[0] == '[':
+                assert line[-1] == ']', '{}:{}'.format(path, lineNum)
+
+                curSectionName = line[1:-1]
+                assert curSectionName not in ret, 'Line {}: Duplicate section: {}'.format(lineNum, line)
+
+                curSectionMap = {}
+                ret[curSectionName] = (lineNum, curSectionMap)
+                continue
+
+            split = line.split('=', 1)
+            key = split[0].strip()
+            val = ''
+            if len(split) == 2:
+                val = split[1].strip()
+
+            curSectionMap[key] = (lineNum, val)
+            continue
+
+    return ret
 
 
 def LoadErrata():
-    nodeMap = {}
+    iniMap = LoadINI(ERRATA_FILE)
 
-    nodeHeader = None
-    nodeLineList = []
-    lineNum = 0
-    with open(ERRATA_FILEPATH, 'rb') as f:
-        for line in f:
-            lineNum += 1
-            line = line.rstrip()
-            cur = line.lstrip()
-            if cur.startswith('#'):
-                continue
+    ret = {}
 
-            if not cur:
-                continue
+    for (sectionName, (sectionLineNum, sectionMap)) in iniMap.iteritems():
+        curLines = []
 
-            if not cur.startswith('['):
-                split = cur.split('=')
-                key = split[0].strip()
-                if not key in ACCEPTABLE_ERRATA_KEYS:
-                    text = 'Unacceptable errata key on line {}: {}'
-                    text = text.format(str(lineNum), key)
-                    raise Exception(text)
-                nodeLineList.append(line)
-                continue
+        if sectionName == None:
+            continue
+        elif sectionName != 'DEFAULT':
+            path = sectionName.replace('/', os.sep)
+            assert os.path.exists(path), 'Line {}: {}'.format(sectionLineNum, sectionName)
 
-            match = kManifestHeaderRegex.search(cur)
-            assert match, line
+        for (key, (lineNum, val)) in sectionMap.iteritems():
+            assert key in ACCEPTABLE_ERRATA_KEYS, 'Line {}: {}'.format(lineNum, key)
 
-            nodeHeader = match.group()
-            assert not nodeHeader in nodeMap, 'Duplicate header: ' + nodeHeader
-            nodeLineList = []
-            nodeMap[nodeHeader] = nodeLineList
+            curLine = '{} = {}'.format(key, val)
+            curLines.append(curLine)
             continue
 
-    return nodeMap
+        ret[sectionName] = curLines
+        continue
+
+    return ret
 
 ########################################################################
 
 def GetSupportFileList():
-    ret = []
-    for supportDir in SUPPORT_DIRS:
-        ret += GetFilePathListForDir(supportDir)
+    ret = EXTRA_SUPPORT_FILES[:]
 
-    ret += EXTRA_SUPPORT_FILES
+    for pathStr in SUPPORT_DIRS:
+        ret += GetFilePathListForDir(pathStr)
+        continue
+
+    for pathStr in ret:
+        path = pathStr.replace('/', os.sep)
+        assert os.path.exists(path), path + '\n\n\n' + 'pathStr: ' + str(pathStr)
+        continue
 
     return ret
 
 
 def GetFilePathListForDir(baseDir):
     ret = []
     for root, folders, files in os.walk(baseDir):
         for f in files:
@@ -371,16 +464,15 @@ def GetFilePathListForDir(baseDir):
 
     return ret
 
 
 if __name__ == '__main__':
     fileDir = os.path.dirname(__file__)
     assert not fileDir, 'Run this file from its directory, not ' + fileDir
 
-    testWebPathList = GetTestList()
+    testPathStrList = GetTestList()
+    wrapperPathStrList = WriteWrappers(testPathStrList)
 
-    wrapperFilePathList = WriteWrappers(testWebPathList)
-
-    supportFilePathList = GetSupportFileList()
-    WriteManifest(wrapperFilePathList, supportFilePathList)
+    supportPathStrList = GetSupportFileList()
+    WriteManifest(wrapperPathStrList, supportPathStrList)
 
     print('Done!')
new file mode 100644
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/iframe-passthrough.css
@@ -0,0 +1,36 @@
+html {
+  height: 100%;
+
+  border: none;
+  /*
+  border-left-style: solid;
+  border-left-color: blue;
+  border-left-width: 4px;
+  */
+}
+
+body {
+  margin: 0px;
+  min-height: 100%;
+
+  display: flex;
+  flex-flow: column;
+
+  border: none;
+  /*
+  border-left-style: solid;
+  border-left-color: green;
+  border-left-width: 4px;
+  */
+}
+
+iframe {
+  flex: auto;
+
+  border: none;
+  /*
+  border-left-style: solid;
+  border-left-color: red;
+  border-left-width: 4px;
+  */
+}
--- a/dom/canvas/test/webgl-conf/mochi-single.html
+++ b/dom/canvas/test/webgl-conf/mochi-single.html
@@ -1,277 +1,64 @@
 <!DOCTYPE HTML>
-<meta http-equiv='content-type' content='text/html; charset=utf-8' />
 <html>
 <head>
-<title>
-WebGL Conformance Test Suite Single Test Wrapper
-</title>
-<!-- Uncomment this to use this without mochi-wrapper.html files.
-<script type='application/javascript' src='/tests/SimpleTest/SimpleTest.js'></script>
-<link rel='stylesheet' type='text/css' href='/tests/SimpleTest/test.css'/>
--->
-<script src='../webgl-mochitest/driver-info.js'></script>
-<script src='iframe-autoresize.js'></script>
+  <meta charset='utf-8'/>
+  <title>
+    WebGL Conformance Test Suite Single Test Wrapper
+  </title>
+  <link rel='stylesheet' type='text/css' href='iframe-passthrough.css'/>
 </head>
-<body style='margin:0'>
-
-<div>Status: <span id='status'>Initializing</span></div>
-<div>Path: <span id='path'>-</span></div>
-<div>Failures: <span id='results'>-</span></div>
-<hr/>
-<iframe style='border:none' id='test-frame' width='100%' scrolling='no'></iframe>
+<body>
+<iframe id='test-frame'></iframe>
 <script>
 'use strict';
 
-var statusElem = document.getElementById('status');
-var pathElem = document.getElementById('path');
-var resultsElem = document.getElementById('results');
 var frameElem = document.getElementById('test-frame');
 
-IFrameAutoresize.Start(frameElem, true);
-
 ////////////////////////////////////////////////////////////////////////
-// Forward SimpleTest functions and replace if missing.
 
-if (!window.ok) {
-  window.ok = parent.ok;
-}
-if (!window.todo) {
-  window.todo = parent.todo;
-}
-if (!window.SimpleTest) {
-  window.SimpleTest = parent.SimpleTest;
-}
+window.webglTestHarness = {
+  reportResults: function(pathname, success, message) {
+    if (parent) {
+      parent.ok(success, message);
+    } else {
+      console.log('ok(' + success + ', \'' + message + '\')');
+    }
+  },
 
-if (!window.ok) {
-  window.ok = function(status, message) {
-    console.log('ok(' + status + ', \'' + message + '\')');
-  }
-}
-if (!window.todo) {
-  window.todo = function(status, message) {
-    console.log('todo(' + status + ', \'' + message + '\')');
+  notifyFinished: function(testPath) {
+    if (parent) {
+      parent.SimpleTest.finish();
+    } else {
+      console.log('SimpleTest.finish()');
+    }
+  },
+};
+
+if (parent) {
+  parent.SimpleTest.waitForExplicitFinish();
+  parent.SimpleTest.requestFlakyTimeout('untriaged');
+
+  try {
+    if (navigator.appVersion.indexOf('Android') != -1) {
+      // From layout/tools/reftest/reftest.js:
+      var version = SpecialPowers.Services.sysinfo.getProperty('version');
+      var kAndroidVersion2_3 = 9;
+      if (version == kAndroidVersion2_3) {
+        var timeoutLengthMultiplier = 2.0;
+        parent.SimpleTest.requestLongerTimeout(timeoutLengthMultiplier);
+      }
+    }
+  } catch (e) {
+    console.log('Warning: No SpecialPowers.');
   }
 }
-if (!window.SimpleTest) {
-  window.SimpleTest = {
-    expectAssertions: function(){},
-    finish: function(){},
-    requestFlakyTimeout: function(){},
-    requestLongerTimeout: function(){},
-    waitForExplicitFinish: function(){},
-  };
-}
 
 ////////////////////////////////////////////////////////////////////////
-// Implement our own version of `fail-if` expected failure handling.
-// `fail-if` in mochitest.ini doesn't work yet. (bug 987849)
 
-var OS_VERSION_WIN7 = 6.1;
-var OS_VERSION_OSX_10_6 = 10.6;
-var OS_VERSION_OSX_10_8 = 10.8;
-
-// ICS 4.0-4.0.2 was 14, 4.0.3+ was 15.
-var OS_VERSION_ANDROID_ICS = 14;
-
-// Jellybean 4.3
-var OS_VERSION_ANDROID_JB = 18;
-
-var ALWAYS_FAIL_TEST_FILEPATH = 'always-fail.html';
-
-function GetExpectedTestFailSet() {
-  var failSet = {};
-
-  failSet[ALWAYS_FAIL_TEST_FILEPATH] = true;
-
-  switch (DriverInfo.getOS()) {
-    case DriverInfo.OS.WINDOWS:
-      if (DriverInfo.getOSVersion() >= OS_VERSION_WIN7) {
-        // Win7 and Win8 slaves.
-        failSet['conformance/textures/tex-image-and-sub-image-2d-with-video.html'] = true;
-        failSet['conformance/textures/texture-npot-video.html'] = true;
-      }
-      break;
-
-    case DriverInfo.OS.MAC:
-      if (DriverInfo.getOSVersion() == OS_VERSION_OSX_10_8) {
-        failSet['conformance/glsl/functions/glsl-function-smoothstep-gentype.html'] = true;
-        failSet['conformance/glsl/variables/gl-pointcoord.html'] = true;
-        failSet['conformance/limits/gl-max-texture-dimensions.html'] = true;
-        failSet['conformance/textures/texture-size.html'] = true;
-      } else if (DriverInfo.getOSVersion() == OS_VERSION_OSX_10_6) {
-        failSet['conformance/glsl/misc/glsl-function-nodes.html'] = true;
-      }
-      break;
-
-    case DriverInfo.OS.LINUX:
-      failSet['conformance/glsl/functions/glsl-function-sin.html'] = true;
-      failSet['conformance/misc/type-conversion-test.html'] = true;
-      failSet['conformance/textures/texture-mips.html'] = true;
-      failSet['conformance/textures/texture-size-cube-maps.html'] = true;
-      break;
-
-    case DriverInfo.OS.ANDROID:
-      if (DriverInfo.getOSVersion() == OS_VERSION_ANDROID_JB) {
-        // Android 4.3 slaves.
-        failSet['conformance/extensions/oes-texture-float.html'] = true;
-        failSet['conformance/glsl/functions/glsl-function-sin.html'] = true;
-        failSet['conformance/misc/object-deletion-behaviour.html'] = true;
-        failSet['conformance/textures/tex-image-with-format-and-type.html'] = true;
-        failSet['conformance/textures/texture-npot.html'] = true;
-        failSet['conformance/textures/texture-size-cube-maps.html'] = true;
-      } else if (DriverInfo.getOSVersion() >= OS_VERSION_ANDROID_ICS) {
-        // Android 4.0 slaves.
-        failSet['conformance/extensions/oes-vertex-array-object.html'] = true;
-        failSet['conformance/glsl/functions/glsl-function-abs.html'] = true;
-        failSet['conformance/glsl/functions/glsl-function-faceforward.html'] = true;
-        failSet['conformance/glsl/functions/glsl-function-sign.html'] = true;
-        failSet['conformance/glsl/functions/glsl-function-smoothstep-float.html'] = true;
-        failSet['conformance/glsl/functions/glsl-function-step-float.html'] = true;
-        failSet['conformance/glsl/functions/glsl-function-step-gentype.html'] = true;
-        failSet['conformance/limits/gl-max-texture-dimensions.html'] = true;
-        failSet['conformance/limits/gl-min-textures.html'] = true;
-        failSet['conformance/rendering/draw-elements-out-of-bounds.html'] = true;
-        failSet['conformance/state/gl-get-calls.html'] = true;
-        failSet['conformance/textures/tex-image-with-format-and-type.html'] = true;
-        failSet['conformance/textures/tex-sub-image-2d.html'] = true;
-        failSet['conformance/textures/texture-size-cube-maps.html'] = true;
-      } else {
-        // Android 2.3 slaves.
-        failSet['conformance/extensions/oes-texture-float.html'] = true;
-        failSet['conformance/glsl/functions/glsl-function-sin.html'] = true;
-        failSet['conformance/misc/object-deletion-behaviour.html'] = true;
-        failSet['conformance/programs/program-test.html'] = true;
-        failSet['conformance/textures/tex-image-and-sub-image-2d-with-video.html'] = true;
-        failSet['conformance/textures/texture-npot.html'] = true;
-      }
-      break;
-
-    case DriverInfo.OS.B2G:
-      failSet['conformance/context/context-attributes-alpha-depth-stencil-antialias.html'] = true;
-      failSet['conformance/glsl/functions/glsl-function-sin.html'] = true;
-      failSet['conformance/glsl/reserved/_webgl_function.vert.html'] = true;
-      failSet['conformance/glsl/reserved/webgl_function.vert.html'] = true;
-      failSet['conformance/misc/error-reporting.html'] = true;
-      failSet['conformance/misc/object-deletion-behaviour.html'] = true;
-      failSet['conformance/programs/get-active-test.html'] = true;
-      failSet['conformance/textures/tex-input-validation.html'] = true;
-      failSet['conformance/textures/texture-npot.html'] = true;
-      failSet['conformance/textures/texture-size-cube-maps.html'] = true;
-      failSet['conformance/textures/texture-size.html'] = true;
-      break;
-  }
-
-  return failSet;
-}
-
-////////////////////////////////////////////////////////////////////////
-// Test running and harness.
-
-var gTestPath = null;
-var gExpectFailures;
-var gIsComplete;
-
-function RunTest(testPath) {
-  console.log('testPath: ' + testPath);
-
-  if (testPath == ALWAYS_FAIL_TEST_FILEPATH) {
-    // Make it easier to respond to new test failures.
-    console.log('OS: ' + DriverInfo.getOS());
-    console.log('OS version: ' + DriverInfo.getOSVersion());
-    console.log('Driver: ' + DriverInfo.getDriver());
-  }
-
-  gTestPath = testPath;
-  pathElem.innerHTML = gTestPath;
-
-  gExpectFailures = (gTestPath in GetExpectedTestFailSet());
-
-  // Load the iframe.
-  statusElem.innerHTML = 'Loading';
-
-  gIsComplete = false;
-  frameElem.onload = function() {
-    if (!gIsComplete)
-      statusElem.innerHTML = 'Running';
-  };
-  frameElem.src = gTestPath;
-}
-
-var gFailureCount = 0;
-var gResultCount = 0;
-window.webglTestHarness = {
-  reportResults: function(success, message) {
-    if (gExpectFailures) {
-      if (success) {
-        ok(success, message);
-      } else {
-        todo(success, message);
-      }
-    } else {
-      ok(success, message);
-    }
-
-    gResultCount++;
-    if (!success) {
-      gFailureCount++;
-    }
-
-    var color = gFailureCount ? 'red' : 'green';
-
-    resultsElem.innerHTML = [
-      '<font color=\'' + color + '\'>',
-      '' + gFailureCount + '/' + gResultCount,
-      '</font>',
-    ].join('\n');
-  },
-
-  notifyFinished: function(testPath) {
-    OnTestComplete();
-  },
-};
-
-function OnTestComplete() {
-  statusElem.innerHTML = 'Complete';
-  gIsComplete = true;
-
-  var hadFailures = gFailureCount != 0;
-
-  if (gExpectFailures) {
-    todo(!hadFailures, 'Expected failures: ' + gTestPath);
-  } else {
-    ok(!hadFailures, 'Expected no failures: ' + gTestPath);
-  }
-  SimpleTest.finish();
-}
-
-////////////////////////////////////////////////////////////////////////
-// Begin execution
-
-SimpleTest.waitForExplicitFinish();
-
-var isAndroid2_3 = (DriverInfo.getOS() == DriverInfo.OS.ANDROID &&
-                    DriverInfo.getOSVersion() < OS_VERSION_ANDROID_ICS);
-if (isAndroid2_3) {
-  var timeoutLengthMultiplier = 2.0;
-  SimpleTest.requestLongerTimeout(timeoutLengthMultiplier);
-}
-
-do {
-  var arg = location.search.substr(1);
-  if (arg == 'dump') {
-    statusElem.innerHTML = 'Dumping';
-
-    ok(true, 'OS:' + DriverInfo.getOS());
-    ok(true, 'OS version:' + DriverInfo.getOSVersion());
-    ok(true, 'Driver:' + DriverInfo.getDriver());
-
-    statusElem.innerHTML = 'Complete';
-    break;
-  }
-
-  RunTest(arg);
-} while (false);
+var testPath = location.search.substr(1);
+console.log('testPath: ' + testPath);
+frameElem.src = testPath;
 
 </script>
 </body>
 </html>
--- a/dom/canvas/test/webgl-conf/mochi-wrapper.html.template
+++ b/dom/canvas/test/webgl-conf/mochi-wrapper.html.template
@@ -1,22 +1,17 @@
-<!-- GENERATED FILE, DO NOT EDIT -->
+%%HEADER%%
 <!DOCTYPE HTML>
-<meta http-equiv='content-type' content='text/html; charset=utf-8' />
 <html>
-<head>
-  <title>
-  Mochitest wrapper for WebGL Conformance Test Suite tests
-  </title>
-  <script src='/tests/SimpleTest/SimpleTest.js'></script>
-  <link rel='stylesheet' type='text/css' href='/tests/SimpleTest/test.css'/>
-  <script src='../iframe-autoresize.js'></script>
-</head>
-<body>
-  <iframe id='mochi-single' style='border:none' width='100%' scrolling='no'
-          src='../mochi-single.html?%%TEST_PATH%%'>
-  </iframe>
-  <script>
-    SimpleTest.requestFlakyTimeout("untriaged");
-    IFrameAutoresize.StartById('mochi-single', false);
-  </script>
-</body>
+  <head>
+    <meta charset='utf-8'/>
+    <title>
+      Mochitest wrapper for WebGL Conformance Test Suite tests
+    </title>
+    <link rel='stylesheet' type='text/css' href='../iframe-passthrough.css'/>
+
+    <script src='/tests/SimpleTest/SimpleTest.js'></script>
+    <link rel='stylesheet' type='text/css' href='/tests/SimpleTest/test.css'/>
+  </head>
+  <body>
+    <iframe src='../mochi-single.html?checkout/%%TEST_PATH%%'></iframe>
+  </body>
 </html>
--- a/dom/canvas/test/webgl-conf/mochitest.ini.template
+++ b/dom/canvas/test/webgl-conf/mochitest.ini.template
@@ -1,8 +1,10 @@
-%%HEADER%%
+# This is a GENERATED FILE. Do not edit it directly.
+# Regenerated it by using `python generate-wrappers-and-manifest.py`.
+# Mark failing (fail-if) and crashing (skip-if) tests in mochitest-errata.ini.
 
 [DEFAULT]
 %%DEFAULT_ERRATA%%
 
 support-files = %%SUPPORT_FILES%%
 
 %%MANIFEST_TESTS%%