Bug 1588190 [wpt PR 19647] - [docs] Include wptrunner docs on web-platform-tests.org, a=testonly
authorMike Pennisi <mike@mikepennisi.com>
Tue, 22 Oct 2019 09:44:01 +0000
changeset 499204 eeb1834f5148a5dfea3b0d2ba15087c7e3482de2
parent 499203 bf4da65a25220382da8e5a334b0c99392a676b42
child 499205 1409177f93c25ee656e46d54152fe721fab9b4c2
push id36736
push usermalexandru@mozilla.com
push dateSat, 26 Oct 2019 22:18:59 +0000
treeherdermozilla-central@51a716d89677 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1588190, 19647
milestone72.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 1588190 [wpt PR 19647] - [docs] Include wptrunner docs on web-platform-tests.org, a=testonly Automatic update from web-platform-tests [docs] Document wptrunner classes These classes are referenced from the ReStructuredText-formatted documentation. -- [docs] Fix build process for wptrunner The Mozilla-provided "intersphinx" metadata does not include an entry for the "mozlog" module. Replace the rST cross-referencing roles with a hyperlink to the documentation webpage. -- [docs] Integrate wptrunner documentation -- [docs] Remove wptrunner-specific tooling -- [docs] Remove outdated content -- [docs] Consolidate info on expectations files -- [docs] Expose a single index for wptrunner docs -- wpt-commits: 61adf1dd0f37b016ce851722c2f3045560c899e1, 1a6f43365b8230df3b25ed28627802199e618b30, 355db3e8653970fab13c78fee743eee667be6025, f5c837e32ff3961266ba76febda0e9b9f520a28e, 94a9a8f0d9520932ffbda2ad6ff7dfcab144979f, 197f2cf0b343f17dc3f0d85b33cdcc62039d9421, 6ffed675082f1faae9b1ca16908efbb333c43dbd wpt-pr: 19647
testing/web-platform/tests/docs/Makefile
testing/web-platform/tests/docs/admin/index.md
testing/web-platform/tests/docs/conf.py
testing/web-platform/tests/docs/make.bat
testing/web-platform/tests/docs/running-tests/from-local-system.md
testing/web-platform/tests/tools/wptrunner/README.rst
testing/web-platform/tests/tools/wptrunner/docs/Makefile
testing/web-platform/tests/tools/wptrunner/docs/conf.py
testing/web-platform/tests/tools/wptrunner/docs/design.rst
testing/web-platform/tests/tools/wptrunner/docs/expectation.rst
testing/web-platform/tests/tools/wptrunner/docs/index.rst
testing/web-platform/tests/tools/wptrunner/docs/internals.rst
testing/web-platform/tests/tools/wptrunner/docs/make.bat
testing/web-platform/tests/tools/wptrunner/docs/usage.rst
testing/web-platform/tests/tools/wptrunner/wptrunner/browsers/base.py
testing/web-platform/tests/tools/wptrunner/wptrunner/environment.py
testing/web-platform/tests/tools/wptrunner/wptrunner/executors/base.py
testing/web-platform/tests/tools/wptrunner/wptrunner/testloader.py
testing/web-platform/tests/tools/wptrunner/wptrunner/testrunner.py
testing/web-platform/tests/tools/wptrunner/wptrunner/wptrunner.py
--- a/testing/web-platform/tests/docs/Makefile
+++ b/testing/web-platform/tests/docs/Makefile
@@ -15,10 +15,10 @@ help:
 
 tools/%:
 	mkdir -p $(shell dirname $@)
 	test -d ../$@
 	ln -s ../../$@ $@
 
 # Catch-all target: route all unknown targets to Sphinx using the new
 # "make mode" option.  $(O) is meant as a shortcut for $(SPHINXOPTS).
-%: Makefile tools/wptserve tools/certs
+%: Makefile tools/wptserve tools/certs tools/wptrunner
 	@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
--- a/testing/web-platform/tests/docs/admin/index.md
+++ b/testing/web-platform/tests/docs/admin/index.md
@@ -6,16 +6,17 @@ infrastructure which makes the project p
 ## Tooling
 
 ```eval_rst
 .. toctree::
    :titlesonly:
 
    ../README
    ../tools/wptserve/docs/index.rst
+   ../tools/wptrunner/README
 
 .. toctree::
    :hidden:
 
    ../tools/wptserve/README
 ```
 
 ## Secrets
--- a/testing/web-platform/tests/docs/conf.py
+++ b/testing/web-platform/tests/docs/conf.py
@@ -38,17 +38,18 @@ release = u''
 # needs_sphinx = '1.0'
 
 # Add any Sphinx extension module names here, as strings. They can be
 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
 # ones.
 extensions = [
     'recommonmark',
     'sphinxarg.ext',
-    'sphinx.ext.autodoc'
+    'sphinx.ext.autodoc',
+    'sphinx.ext.intersphinx'
 ]
 
 # Add any paths that contain templates here, relative to this directory.
 templates_path = ['_templates']
 
 # The suffix(es) of source filenames.
 # You can specify multiple suffix as a list of string:
 #
@@ -186,8 +187,11 @@ epub_title = project
 # epub_identifier = ''
 
 # A unique identification for the text.
 #
 # epub_uid = ''
 
 # A list of files that should not be packed into the epub file.
 epub_exclude_files = ['search.html']
+
+intersphinx_mapping = {'python': ('https://docs.python.org/2/', None),
+                       'mozilla': ('https://firefox-source-docs.mozilla.org/', None)}
--- a/testing/web-platform/tests/docs/make.bat
+++ b/testing/web-platform/tests/docs/make.bat
@@ -24,16 +24,17 @@ if errorlevel 9009 (
 	echo.http://sphinx-doc.org/
 	exit /b 1
 )
 
 if not exist tools\ ( mkdir tools )
 
 if not exist tools\wptserve\ ( mklink /d tools\wptserve ..\..\tools\wptserve )
 if not exist tools\certs\ ( mklink /d tools\certs ..\..\tools\certs )
+if not exist tools\wptrunner\ ( mklink /d tools\wptrunner ..\..\tools\wptrunner )
 
 %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
 goto end
 
 :help
 %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
 
 :end
--- a/testing/web-platform/tests/docs/running-tests/from-local-system.md
+++ b/testing/web-platform/tests/docs/running-tests/from-local-system.md
@@ -142,8 +142,14 @@ Additional browser-specific documentatio
 .. toctree::
 
   chrome
   chrome_android
   android_webview
   safari
   webkitgtk_minibrowser
 ```
+
+For use in continuous integration systems, and other scenarios where regression
+tracking is required, the command-line interface supports storing and loading
+the expected result of each test in a test run. See [Expectations
+Data](../../tools/wptrunner/docs/expectation) for more information on creating
+and maintaining these files.
--- a/testing/web-platform/tests/tools/wptrunner/README.rst
+++ b/testing/web-platform/tests/tools/wptrunner/README.rst
@@ -1,241 +1,14 @@
 wptrunner: A web-platform-tests harness
 =======================================
 
 wptrunner is a harness for running the W3C `web-platform-tests testsuite`_.
 
-.. contents::
-
-Installation
-~~~~~~~~~~~~
-
-wptrunner is expected to be installed into a virtualenv using pip. For
-development, it can be installed using the `-e` option::
-
-  pip install -e ./
-
-Running the Tests
-~~~~~~~~~~~~~~~~~
-
-After installation, the command ``wptrunner`` should be available to run
-the tests.
-
-The ``wptrunner`` command  takes multiple options, of which the
-following are most significant:
-
-``--product`` (defaults to `firefox`)
-  The product to test against: `chrome`, `firefox`, or `servo`.
-
-``--binary`` (required if product is `firefox` or `servo`)
-  The path to a binary file for the product (browser) to test against.
-
-``--webdriver-binary`` (required if product is `chrome`)
-  The path to a `driver` binary; e.g., a `chromedriver` binary.
-
-``--certutil-binary`` (required if product is `firefox` [#]_)
-  The path to a `certutil` binary (for tests that must be run over https).
-
-``--metadata`` (required)
-  The path to a directory containing test metadata. [#]_
-
-``--tests`` (required)
-  The path to a directory containing a web-platform-tests checkout.
-
-``--prefs-root`` (required only when testing a Firefox binary)
-  The path to a directory containing Firefox test-harness preferences. [#]_
-
-``--config`` (should default to `wptrunner.default.ini`)
-  The path to the config (ini) file.
-
-.. [#] The ``--certutil-binary`` option is required when the product is
-   ``firefox`` unless ``--ssl-type=none`` is specified.
-
-.. [#] The ``--metadata`` path is to a directory that contains:
-
-  * a ``MANIFEST.json`` file (instructions on generating this file are
-    available in the `detailed documentation
-    <http://wptrunner.readthedocs.org/en/latest/usage.html#installing-wptrunner>`_);
-    and
-  * (optionally) any expectation files (see below)
-
-.. [#] Example ``--prefs-root`` value: ``~/mozilla-central/testing/profiles``.
-
-There are also a variety of other options available; use ``--help`` to
-list them.
-
--------------------------------
-Example: How to start wptrunner
--------------------------------
-
-To test a Firefox Nightly build in an OS X environment, you might start
-wptrunner using something similar to the following example::
-
-  wptrunner --metadata=~/web-platform-tests/ --tests=~/web-platform-tests/ \
-    --binary=~/mozilla-central/obj-x86_64-apple-darwin14.3.0/dist/Nightly.app/Contents/MacOS/firefox \
-    --certutil-binary=~/mozilla-central/obj-x86_64-apple-darwin14.3.0/security/nss/cmd/certutil/certutil \
-    --prefs-root=~/mozilla-central/testing/profiles
-
-And to test a Chromium build in an OS X environment, you might start
-wptrunner using something similar to the following example::
-
-  wptrunner --metadata=~/web-platform-tests/ --tests=~/web-platform-tests/ \
-    --binary=~/chromium/src/out/Release/Chromium.app/Contents/MacOS/Chromium \
-    --webdriver-binary=/usr/local/bin/chromedriver --product=chrome
-
--------------------------------------
-Example: How to run a subset of tests
--------------------------------------
-
-To restrict a test run just to tests in a particular web-platform-tests
-subdirectory, specify the directory name in the positional arguments after
-the options; for example, run just the tests in the `dom` subdirectory::
-
-  wptrunner --metadata=~/web-platform-tests/ --tests=~/web-platform-tests/ \
-    --binary=/path/to/firefox --certutil-binary=/path/to/certutil \
-    --prefs-root=/path/to/testing/profiles \
-    dom
-
-Output
-~~~~~~
-
-By default wptrunner just dumps its entire output as raw JSON messages
-to stdout. This is convenient for piping into other tools, but not ideal
-for humans reading the output.
-
-As an alternative, you can use the ``--log-mach`` option, which provides
-output in a reasonable format for humans. The option requires a value:
-either the path for a file to write the `mach`-formatted output to, or
-"`-`" (a hyphen) to write the `mach`-formatted output to stdout.
-
-When using ``--log-mach``, output of the full raw JSON log is still
-available, from the ``--log-raw`` option. So to output the full raw JSON
-log to a file and a human-readable summary to stdout, you might start
-wptrunner using something similar to the following example::
-
-  wptrunner --metadata=~/web-platform-tests/ --tests=~/web-platform-tests/ \
-    --binary=/path/to/firefox --certutil-binary=/path/to/certutil \
-    --prefs-root=/path/to/testing/profiles \
-    --log-raw=output.log --log-mach=-
-
-Expectation Data
-~~~~~~~~~~~~~~~~
+.. toctree::
+   :maxdepth: 2
 
-wptrunner is designed to be used in an environment where it is not
-just necessary to know which tests passed, but to compare the results
-between runs. For this reason it is possible to store the results of a
-previous run in a set of ini-like "expectation files". This format is
-documented below. To generate the expectation files use `wptrunner` with
-the `--log-raw=/path/to/log/file` option. This can then be used as
-input to the `wptupdate` tool.
-
-Expectation File Format
-~~~~~~~~~~~~~~~~~~~~~~~
-
-Metadata about tests, notably including their expected results, is
-stored in a modified ini-like format that is designed to be human
-editable, but also to be machine updatable.
-
-Each test file that requires metadata to be specified (because it has
-a non-default expectation or because it is disabled, for example) has
-a corresponding expectation file in the `metadata` directory. For
-example a test file `html/test1.html` containing a failing test would
-have an expectation file called `html/test1.html.ini` in the
-`metadata` directory.
-
-An example of an expectation file is::
-
-  example_default_key: example_value
-
-  [filename.html]
-    [subtest1]
-      expected: FAIL
-
-    [subtest2]
-      expected:
-        if platform == 'win': TIMEOUT
-        if platform == 'osx': ERROR
-        FAIL
-
-    [subtest3]
-      expected: [PASS, TIMEOUT]
-
-  [filename.html?query=something]
-    disabled: bug12345
-
-The file consists of two elements, key-value pairs and
-sections.
-
-Sections are delimited by headings enclosed in square brackets. Any
-closing square bracket in the heading itself my be escaped with a
-backslash. Each section may then contain any number of key-value pairs
-followed by any number of subsections. So that it is clear which data
-belongs to each section without the use of end-section markers, the
-data for each section (i.e. the key-value pairs and subsections) must
-be indented using spaces. Indentation need only be consistent, but
-using two spaces per level is recommended.
-
-In a test expectation file, each resource provided by the file has a
-single section, with the section heading being the part after the last
-`/` in the test url. Tests that have subsections may have subsections
-for those subtests in which the heading is the name of the subtest.
-
-Simple key-value pairs are of the form::
-
-  key: value
-
-Note that unlike ini files, only `:` is a valid separator; `=` will
-not work as expected. Key-value pairs may also have conditional
-values of the form::
-
-  key:
-    if condition1: value1
-    if condition2: value2
-    default
-
-In this case each conditional is evaluated in turn and the value is
-that on the right hand side of the first matching conditional. In the
-case that no condition matches, the unconditional default is used. If
-no condition matches and no default is provided it is equivalent to
-the key not being present. Conditionals use a simple python-like expression
-language e.g.::
-
-  if debug and (platform == "linux" or platform == "osx"): FAIL
-
-For test expectations the available variables are those in the
-`run_info` which for desktop are `version`, `os`, `bits`, `processor`,
-`debug` and `product`.
-
-Key-value pairs specified at the top level of the file before any
-sections are special as they provide defaults for the rest of the file
-e.g.::
-
-  key1: value1
-
-  [section 1]
-    key2: value2
-
-  [section 2]
-    key1: value3
-
-In this case, inside section 1, `key1` would have the value `value1`
-and `key2` the value `value2` whereas in section 2 `key1` would have
-the value `value3` and `key2` would be undefined.
-
-The web-platform-test harness knows about several keys:
-
-`expected`
-  Must evaluate to a possible test status indicating the expected
-  result of the test. The implicit default is PASS or OK when the
-  field isn't present. When `expected` is a list, the first status
-  is the primary expected status and the trailing statuses listed are
-  expected intermittent statuses.
-
-`disabled`
-  Any value indicates that the test is disabled.
-
-`reftype`
-  The type of comparison for reftests; either `==` or `!=`.
-
-`refurl`
-  The reference url for reftests.
+   docs/usage
+   docs/expectation
+   docs/design
+   docs/internals
 
 .. _`web-platform-tests testsuite`: https://github.com/web-platform-tests/wpt
deleted file mode 100644
--- a/testing/web-platform/tests/tools/wptrunner/docs/Makefile
+++ /dev/null
@@ -1,177 +0,0 @@
-# Makefile for Sphinx documentation
-#
-
-# You can set these variables from the command line.
-SPHINXOPTS    =
-SPHINXBUILD   = sphinx-build
-PAPER         =
-BUILDDIR      = _build
-
-# User-friendly check for sphinx-build
-ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
-$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
-endif
-
-# Internal variables.
-PAPEROPT_a4     = -D latex_paper_size=a4
-PAPEROPT_letter = -D latex_paper_size=letter
-ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
-# the i18n builder cannot share the environment and doctrees with the others
-I18NSPHINXOPTS  = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
-
-.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
-
-help:
-	@echo "Please use \`make <target>' where <target> is one of"
-	@echo "  html       to make standalone HTML files"
-	@echo "  dirhtml    to make HTML files named index.html in directories"
-	@echo "  singlehtml to make a single large HTML file"
-	@echo "  pickle     to make pickle files"
-	@echo "  json       to make JSON files"
-	@echo "  htmlhelp   to make HTML files and a HTML help project"
-	@echo "  qthelp     to make HTML files and a qthelp project"
-	@echo "  devhelp    to make HTML files and a Devhelp project"
-	@echo "  epub       to make an epub"
-	@echo "  latex      to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
-	@echo "  latexpdf   to make LaTeX files and run them through pdflatex"
-	@echo "  latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
-	@echo "  text       to make text files"
-	@echo "  man        to make manual pages"
-	@echo "  texinfo    to make Texinfo files"
-	@echo "  info       to make Texinfo files and run them through makeinfo"
-	@echo "  gettext    to make PO message catalogs"
-	@echo "  changes    to make an overview of all changed/added/deprecated items"
-	@echo "  xml        to make Docutils-native XML files"
-	@echo "  pseudoxml  to make pseudoxml-XML files for display purposes"
-	@echo "  linkcheck  to check all external links for integrity"
-	@echo "  doctest    to run all doctests embedded in the documentation (if enabled)"
-
-clean:
-	rm -rf $(BUILDDIR)/*
-
-html:
-	$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
-	@echo
-	@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
-
-dirhtml:
-	$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
-	@echo
-	@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
-
-singlehtml:
-	$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
-	@echo
-	@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
-
-pickle:
-	$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
-	@echo
-	@echo "Build finished; now you can process the pickle files."
-
-json:
-	$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
-	@echo
-	@echo "Build finished; now you can process the JSON files."
-
-htmlhelp:
-	$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
-	@echo
-	@echo "Build finished; now you can run HTML Help Workshop with the" \
-	      ".hhp project file in $(BUILDDIR)/htmlhelp."
-
-qthelp:
-	$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
-	@echo
-	@echo "Build finished; now you can run "qcollectiongenerator" with the" \
-	      ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
-	@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/wptrunner.qhcp"
-	@echo "To view the help file:"
-	@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/wptrunner.qhc"
-
-devhelp:
-	$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
-	@echo
-	@echo "Build finished."
-	@echo "To view the help file:"
-	@echo "# mkdir -p $$HOME/.local/share/devhelp/wptrunner"
-	@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/wptrunner"
-	@echo "# devhelp"
-
-epub:
-	$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
-	@echo
-	@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
-
-latex:
-	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
-	@echo
-	@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
-	@echo "Run \`make' in that directory to run these through (pdf)latex" \
-	      "(use \`make latexpdf' here to do that automatically)."
-
-latexpdf:
-	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
-	@echo "Running LaTeX files through pdflatex..."
-	$(MAKE) -C $(BUILDDIR)/latex all-pdf
-	@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
-
-latexpdfja:
-	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
-	@echo "Running LaTeX files through platex and dvipdfmx..."
-	$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
-	@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
-
-text:
-	$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
-	@echo
-	@echo "Build finished. The text files are in $(BUILDDIR)/text."
-
-man:
-	$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
-	@echo
-	@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
-
-texinfo:
-	$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
-	@echo
-	@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
-	@echo "Run \`make' in that directory to run these through makeinfo" \
-	      "(use \`make info' here to do that automatically)."
-
-info:
-	$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
-	@echo "Running Texinfo files through makeinfo..."
-	make -C $(BUILDDIR)/texinfo info
-	@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
-
-gettext:
-	$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
-	@echo
-	@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
-
-changes:
-	$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
-	@echo
-	@echo "The overview file is in $(BUILDDIR)/changes."
-
-linkcheck:
-	$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
-	@echo
-	@echo "Link check complete; look for any errors in the above output " \
-	      "or in $(BUILDDIR)/linkcheck/output.txt."
-
-doctest:
-	$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
-	@echo "Testing of doctests in the sources finished, look at the " \
-	      "results in $(BUILDDIR)/doctest/output.txt."
-
-xml:
-	$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
-	@echo
-	@echo "Build finished. The XML files are in $(BUILDDIR)/xml."
-
-pseudoxml:
-	$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
-	@echo
-	@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
deleted file mode 100644
--- a/testing/web-platform/tests/tools/wptrunner/docs/conf.py
+++ /dev/null
@@ -1,267 +0,0 @@
-# -*- coding: utf-8 -*-
-#
-# wptrunner documentation build configuration file, created by
-# sphinx-quickstart on Mon May 19 18:14:20 2014.
-#
-# This file is execfile()d with the current directory set to its
-# containing dir.
-#
-# Note that not all possible configuration values are present in this
-# autogenerated file.
-#
-# All configuration values have a default; values that are commented out
-# serve to show the default.
-
-#import sys
-#import os
-
-# If extensions (or modules to document with autodoc) are in another directory,
-# add these directories to sys.path here. If the directory is relative to the
-# documentation root, use os.path.abspath to make it absolute, like shown here.
-#sys.path.insert(0, os.path.abspath('.'))
-
-# -- General configuration ------------------------------------------------
-
-# If your documentation needs a minimal Sphinx version, state it here.
-#needs_sphinx = '1.0'
-
-# Add any Sphinx extension module names here, as strings. They can be
-# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
-# ones.
-extensions = [
-    'sphinx.ext.autodoc',
-    'sphinx.ext.intersphinx',
-    'sphinx.ext.viewcode',
-]
-
-# Add any paths that contain templates here, relative to this directory.
-templates_path = ['_templates']
-
-# The suffix of source filenames.
-source_suffix = '.rst'
-
-# The encoding of source files.
-#source_encoding = 'utf-8-sig'
-
-# The master toctree document.
-master_doc = 'index'
-
-# General information about the project.
-project = u'wptrunner'
-copyright = u''
-
-# The version info for the project you're documenting, acts as replacement for
-# |version| and |release|, also used in various other places throughout the
-# built documents.
-#
-# The short X.Y version.
-version = '0.3'
-# The full version, including alpha/beta/rc tags.
-release = '0.3'
-
-# The language for content autogenerated by Sphinx. Refer to documentation
-# for a list of supported languages.
-#language = None
-
-# There are two options for replacing |today|: either, you set today to some
-# non-false value, then it is used:
-#today = ''
-# Else, today_fmt is used as the format for a strftime call.
-#today_fmt = '%B %d, %Y'
-
-# List of patterns, relative to source directory, that match files and
-# directories to ignore when looking for source files.
-exclude_patterns = ['_build']
-
-# The reST default role (used for this markup: `text`) to use for all
-# documents.
-#default_role = None
-
-# If true, '()' will be appended to :func: etc. cross-reference text.
-#add_function_parentheses = True
-
-# If true, the current module name will be prepended to all description
-# unit titles (such as .. function::).
-#add_module_names = True
-
-# If true, sectionauthor and moduleauthor directives will be shown in the
-# output. They are ignored by default.
-#show_authors = False
-
-# The name of the Pygments (syntax highlighting) style to use.
-pygments_style = 'sphinx'
-
-# A list of ignored prefixes for module index sorting.
-#modindex_common_prefix = []
-
-# If true, keep warnings as "system message" paragraphs in the built documents.
-#keep_warnings = False
-
-
-# -- Options for HTML output ----------------------------------------------
-
-# The theme to use for HTML and HTML Help pages.  See the documentation for
-# a list of builtin themes.
-html_theme = 'default'
-
-# Theme options are theme-specific and customize the look and feel of a theme
-# further.  For a list of options available for each theme, see the
-# documentation.
-#html_theme_options = {}
-
-# Add any paths that contain custom themes here, relative to this directory.
-#html_theme_path = []
-
-# The name for this set of Sphinx documents.  If None, it defaults to
-# "<project> v<release> documentation".
-#html_title = None
-
-# A shorter title for the navigation bar.  Default is the same as html_title.
-#html_short_title = None
-
-# The name of an image file (relative to this directory) to place at the top
-# of the sidebar.
-#html_logo = None
-
-# The name of an image file (within the static path) to use as favicon of the
-# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
-# pixels large.
-#html_favicon = None
-
-# Add any paths that contain custom static files (such as style sheets) here,
-# relative to this directory. They are copied after the builtin static files,
-# so a file named "default.css" will overwrite the builtin "default.css".
-html_static_path = ['_static']
-
-# Add any extra paths that contain custom files (such as robots.txt or
-# .htaccess) here, relative to this directory. These files are copied
-# directly to the root of the documentation.
-#html_extra_path = []
-
-# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
-# using the given strftime format.
-#html_last_updated_fmt = '%b %d, %Y'
-
-# If true, SmartyPants will be used to convert quotes and dashes to
-# typographically correct entities.
-#html_use_smartypants = True
-
-# Custom sidebar templates, maps document names to template names.
-#html_sidebars = {}
-
-# Additional templates that should be rendered to pages, maps page names to
-# template names.
-#html_additional_pages = {}
-
-# If false, no module index is generated.
-#html_domain_indices = True
-
-# If false, no index is generated.
-#html_use_index = True
-
-# If true, the index is split into individual pages for each letter.
-#html_split_index = False
-
-# If true, links to the reST sources are added to the pages.
-#html_show_sourcelink = True
-
-# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
-#html_show_sphinx = True
-
-# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
-#html_show_copyright = True
-
-# If true, an OpenSearch description file will be output, and all pages will
-# contain a <link> tag referring to it.  The value of this option must be the
-# base URL from which the finished HTML is served.
-#html_use_opensearch = ''
-
-# This is the file name suffix for HTML files (e.g. ".xhtml").
-#html_file_suffix = None
-
-# Output file base name for HTML help builder.
-htmlhelp_basename = 'wptrunnerdoc'
-
-
-# -- Options for LaTeX output ---------------------------------------------
-
-latex_elements = {
-    # The paper size ('letterpaper' or 'a4paper').
-    #'papersize': 'letterpaper',
-
-    # The font size ('10pt', '11pt' or '12pt').
-    #'pointsize': '10pt',
-
-    # Additional stuff for the LaTeX preamble.
-    #'preamble': '',
-}
-
-# Grouping the document tree into LaTeX files. List of tuples
-# (source start file, target name, title,
-#  author, documentclass [howto, manual, or own class]).
-latex_documents = [
-    ('index', 'wptrunner.tex', u'wptrunner Documentation',
-     u'James Graham', 'manual'),
-]
-
-# The name of an image file (relative to this directory) to place at the top of
-# the title page.
-#latex_logo = None
-
-# For "manual" documents, if this is true, then toplevel headings are parts,
-# not chapters.
-#latex_use_parts = False
-
-# If true, show page references after internal links.
-#latex_show_pagerefs = False
-
-# If true, show URL addresses after external links.
-#latex_show_urls = False
-
-# Documents to append as an appendix to all manuals.
-#latex_appendices = []
-
-# If false, no module index is generated.
-#latex_domain_indices = True
-
-
-# -- Options for manual page output ---------------------------------------
-
-# One entry per manual page. List of tuples
-# (source start file, name, description, authors, manual section).
-man_pages = [
-    ('index', 'wptrunner', u'wptrunner Documentation',
-     [u'James Graham'], 1)
-]
-
-# If true, show URL addresses after external links.
-#man_show_urls = False
-
-
-# -- Options for Texinfo output -------------------------------------------
-
-# Grouping the document tree into Texinfo files. List of tuples
-# (source start file, target name, title, author,
-#  dir menu entry, description, category)
-texinfo_documents = [
-    ('index', 'wptrunner', u'wptrunner Documentation',
-     u'James Graham', 'wptrunner', 'One line description of project.',
-     'Miscellaneous'),
-]
-
-# Documents to append as an appendix to all manuals.
-#texinfo_appendices = []
-
-# If false, no module index is generated.
-#texinfo_domain_indices = True
-
-# How to display URL addresses: 'footnote', 'no', or 'inline'.
-#texinfo_show_urls = 'footnote'
-
-# If true, do not generate a @detailmenu in the "Top" node's menu.
-#texinfo_no_detailmenu = False
-
-
-# Example configuration for intersphinx: refer to the Python standard library.
-intersphinx_mapping = {'python': ('http://docs.python.org/', None),
-                       'mozlog': ('https://firefox-source-docs.mozilla.org/', None)}
--- a/testing/web-platform/tests/tools/wptrunner/docs/design.rst
+++ b/testing/web-platform/tests/tools/wptrunner/docs/design.rst
@@ -38,69 +38,71 @@ The harness will typically communicate w
 control protocol such as WebDriver. However for browsers where no such
 protocol is supported, other implementation strategies are possible,
 typically at the expense of speed.
 
 The overall architecture of wptrunner is shown in the diagram below:
 
 .. image:: architecture.svg
 
-The main entry point to the code is :py:func:`run_tests` in
+.. currentmodule:: wptrunner
+
+The main entry point to the code is :py:func:`~wptrunner.run_tests` in
 ``wptrunner.py``. This is responsible for setting up the test
 environment, loading the list of tests to be executed, and invoking
 the remainder of the code to actually execute some tests.
 
 The test environment is encapsulated in the
-:py:class:`TestEnvironment` class. This defers to code in
+:py:class:`~environment.TestEnvironment` class. This defers to code in
 ``web-platform-tests`` which actually starts the required servers to
 run the tests.
 
 The set of tests to run is defined by the
-:py:class:`TestLoader`. This is constructed with a
-:py:class:`TestFilter` (not shown), which takes any filter arguments
+:py:class:`~testloader.TestLoader`. This is constructed with a
+:py:class:`~testloader.TestFilter` (not shown), which takes any filter arguments
 from the command line to restrict the set of tests that will be
-run. The :py:class:`TestLoader` reads both the ``web-platform-tests``
+run. The :py:class:`~testloader.TestLoader` reads both the ``web-platform-tests``
 JSON manifest and the expectation data stored in ini files and
 produces a :py:class:`multiprocessing.Queue` of tests to run, and
 their expected results.
 
 Actually running the tests happens through the
-:py:class:`ManagerGroup` object. This takes the :py:class:`Queue` of
-tests to be run and starts a :py:class:`testrunner.TestRunnerManager` for each
+:py:class:`~testrunner.ManagerGroup` object. This takes the :py:class:`~multiprocessing.Queue` of
+tests to be run and starts a :py:class:`~testrunner.TestRunnerManager` for each
 instance of the browser under test that will be started. These
-:py:class:`TestRunnerManager` instances are each started in their own
+:py:class:`~testrunner.TestRunnerManager` instances are each started in their own
 thread.
 
-A :py:class:`TestRunnerManager` coordinates starting the product under
+A :py:class:`~testrunner.TestRunnerManager` coordinates starting the product under
 test, and outputting results from the test. In the case that the test
 has timed out or the browser has crashed, it has to restart the
 browser to ensure the test run can continue. The functionality for
 initialising the browser under test, and probing its state
 (e.g. whether the process is still alive) is implemented through a
-:py:class:`Browser` object. An implementation of this class must be
+:py:class:`~browsers.base.Browser` object. An implementation of this class must be
 provided for each product that is supported.
 
 The functionality for actually running the tests is provided by a
-:py:class:`TestRunner` object. :py:class:`TestRunner` instances are
+:py:class:`~testrunner.TestRunner` object. :py:class:`~testrunner.TestRunner` instances are
 run in their own child process created with the
 :py:mod:`multiprocessing` module. This allows them to run concurrently
 and to be killed and restarted as required. Communication between the
-:py:class:`TestRunnerManager` and the :py:class:`TestRunner` is
+:py:class:`~testrunner.TestRunnerManager` and the :py:class:`~testrunner.TestRunner` is
 provided by a pair of queues, one for sending messages in each
 direction. In particular test results are sent from the
-:py:class:`TestRunner` to the :py:class:`TestRunnerManager` using one
+:py:class:`~testrunner.TestRunner` to the :py:class:`~testrunner.TestRunnerManager` using one
 of these queues.
 
-The :py:class:`TestRunner` object is generic in that the same
-:py:class:`TestRunner` is used regardless of the product under
+The :py:class:`~testrunner.TestRunner` object is generic in that the same
+:py:class:`~testrunner.TestRunner` is used regardless of the product under
 test. However the details of how to run the test may vary greatly with
 the product since different products support different remote control
 protocols (or none at all). These protocol-specific parts are placed
-in the :py:class:`Executor` object. There is typically a different
-:py:class:`Executor` class for each combination of control protocol
-and test type. The :py:class:`TestRunner` is responsible for pulling
-each test off the :py:class:`Queue` of tests and passing it down to
-the :py:class:`Executor`.
+in the :py:class:`~executors.base.TestExecutor` object. There is typically a different
+:py:class:`~executors.base.TestExecutor` class for each combination of control protocol
+and test type. The :py:class:`~testrunner.TestRunner` is responsible for pulling
+each test off the :py:class:`multiprocessing.Queue` of tests and passing it down to
+the :py:class:`~executors.base.TestExecutor`.
 
 The executor often requires access to details of the particular
 browser instance that it is testing so that it knows e.g. which port
 to connect to to send commands to the browser. These details are
-encapsulated in the :py:class:`ExecutorBrowser` class.
+encapsulated in the :py:class:`~browsers.base.ExecutorBrowser` class.
--- a/testing/web-platform/tests/tools/wptrunner/docs/expectation.rst
+++ b/testing/web-platform/tests/tools/wptrunner/docs/expectation.rst
@@ -155,16 +155,34 @@ A simple example of a manifest file is::
     section_key: section_value
 
     [subsection]
        subsection_key: subsection_value
 
   [another_section]
     another_key: another_value
 
+The web-platform-test harness knows about several keys:
+
+`expected`
+  Must evaluate to a possible test status indicating the expected
+  result of the test. The implicit default is PASS or OK when the
+  field isn't present. When `expected` is a list, the first status
+  is the primary expected status and the trailing statuses listed are
+  expected intermittent statuses.
+
+`disabled`
+  Any value indicates that the test is disabled.
+
+`reftype`
+  The type of comparison for reftests; either `==` or `!=`.
+
+`refurl`
+  The reference url for reftests.
+
 Conditional Values
 ~~~~~~~~~~~~~~~~~~
 
 In order to support values that depend on some external data, the
 right hand side of a key/value pair can take a set of conditionals
 rather than a plain value. These values are placed on a new line
 following the key, with significant indentation. Conditional values
 are prefixed with ``if`` and terminated with a colon, for example::
deleted file mode 100644
--- a/testing/web-platform/tests/tools/wptrunner/docs/index.rst
+++ /dev/null
@@ -1,24 +0,0 @@
-.. wptrunner documentation master file, created by
-   sphinx-quickstart on Mon May 19 18:14:20 2014.
-   You can adapt this file completely to your liking, but it should at least
-   contain the root `toctree` directive.
-
-Welcome to wptrunner's documentation!
-=====================================
-
-Contents:
-
-.. toctree::
-   :maxdepth: 2
-
-   usage
-   expectation
-   design
-
-Indices and tables
-==================
-
-* :ref:`genindex`
-* :ref:`modindex`
-* :ref:`search`
-
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/tools/wptrunner/docs/internals.rst
@@ -0,0 +1,23 @@
+wptrunner Internals
+===================
+
+.. These modules are intentionally referenced as submodules from the parent
+   directory. This ensures that Sphinx interprets them as packages.
+
+.. automodule:: wptrunner.browsers.base
+   :members:
+
+.. automodule:: wptrunner.environment
+   :members:
+
+.. automodule:: wptrunner.executors.base
+   :members:
+
+.. automodule:: wptrunner.wptrunner
+   :members:
+
+.. automodule:: wptrunner.testloader
+   :members:
+
+.. automodule:: wptrunner.testrunner
+   :members:
deleted file mode 100644
--- a/testing/web-platform/tests/tools/wptrunner/docs/make.bat
+++ /dev/null
@@ -1,242 +0,0 @@
-@ECHO OFF
-
-REM Command file for Sphinx documentation
-
-if "%SPHINXBUILD%" == "" (
-	set SPHINXBUILD=sphinx-build
-)
-set BUILDDIR=_build
-set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
-set I18NSPHINXOPTS=%SPHINXOPTS% .
-if NOT "%PAPER%" == "" (
-	set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
-	set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS%
-)
-
-if "%1" == "" goto help
-
-if "%1" == "help" (
-	:help
-	echo.Please use `make ^<target^>` where ^<target^> is one of
-	echo.  html       to make standalone HTML files
-	echo.  dirhtml    to make HTML files named index.html in directories
-	echo.  singlehtml to make a single large HTML file
-	echo.  pickle     to make pickle files
-	echo.  json       to make JSON files
-	echo.  htmlhelp   to make HTML files and a HTML help project
-	echo.  qthelp     to make HTML files and a qthelp project
-	echo.  devhelp    to make HTML files and a Devhelp project
-	echo.  epub       to make an epub
-	echo.  latex      to make LaTeX files, you can set PAPER=a4 or PAPER=letter
-	echo.  text       to make text files
-	echo.  man        to make manual pages
-	echo.  texinfo    to make Texinfo files
-	echo.  gettext    to make PO message catalogs
-	echo.  changes    to make an overview over all changed/added/deprecated items
-	echo.  xml        to make Docutils-native XML files
-	echo.  pseudoxml  to make pseudoxml-XML files for display purposes
-	echo.  linkcheck  to check all external links for integrity
-	echo.  doctest    to run all doctests embedded in the documentation if enabled
-	goto end
-)
-
-if "%1" == "clean" (
-	for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
-	del /q /s %BUILDDIR%\*
-	goto end
-)
-
-
-%SPHINXBUILD% 2> nul
-if errorlevel 9009 (
-	echo.
-	echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
-	echo.installed, then set the SPHINXBUILD environment variable to point
-	echo.to the full path of the 'sphinx-build' executable. Alternatively you
-	echo.may add the Sphinx directory to PATH.
-	echo.
-	echo.If you don't have Sphinx installed, grab it from
-	echo.http://sphinx-doc.org/
-	exit /b 1
-)
-
-if "%1" == "html" (
-	%SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
-	if errorlevel 1 exit /b 1
-	echo.
-	echo.Build finished. The HTML pages are in %BUILDDIR%/html.
-	goto end
-)
-
-if "%1" == "dirhtml" (
-	%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
-	if errorlevel 1 exit /b 1
-	echo.
-	echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
-	goto end
-)
-
-if "%1" == "singlehtml" (
-	%SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
-	if errorlevel 1 exit /b 1
-	echo.
-	echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
-	goto end
-)
-
-if "%1" == "pickle" (
-	%SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
-	if errorlevel 1 exit /b 1
-	echo.
-	echo.Build finished; now you can process the pickle files.
-	goto end
-)
-
-if "%1" == "json" (
-	%SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
-	if errorlevel 1 exit /b 1
-	echo.
-	echo.Build finished; now you can process the JSON files.
-	goto end
-)
-
-if "%1" == "htmlhelp" (
-	%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
-	if errorlevel 1 exit /b 1
-	echo.
-	echo.Build finished; now you can run HTML Help Workshop with the ^
-.hhp project file in %BUILDDIR%/htmlhelp.
-	goto end
-)
-
-if "%1" == "qthelp" (
-	%SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
-	if errorlevel 1 exit /b 1
-	echo.
-	echo.Build finished; now you can run "qcollectiongenerator" with the ^
-.qhcp project file in %BUILDDIR%/qthelp, like this:
-	echo.^> qcollectiongenerator %BUILDDIR%\qthelp\wptrunner.qhcp
-	echo.To view the help file:
-	echo.^> assistant -collectionFile %BUILDDIR%\qthelp\wptrunner.ghc
-	goto end
-)
-
-if "%1" == "devhelp" (
-	%SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
-	if errorlevel 1 exit /b 1
-	echo.
-	echo.Build finished.
-	goto end
-)
-
-if "%1" == "epub" (
-	%SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
-	if errorlevel 1 exit /b 1
-	echo.
-	echo.Build finished. The epub file is in %BUILDDIR%/epub.
-	goto end
-)
-
-if "%1" == "latex" (
-	%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
-	if errorlevel 1 exit /b 1
-	echo.
-	echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
-	goto end
-)
-
-if "%1" == "latexpdf" (
-	%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
-	cd %BUILDDIR%/latex
-	make all-pdf
-	cd %BUILDDIR%/..
-	echo.
-	echo.Build finished; the PDF files are in %BUILDDIR%/latex.
-	goto end
-)
-
-if "%1" == "latexpdfja" (
-	%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
-	cd %BUILDDIR%/latex
-	make all-pdf-ja
-	cd %BUILDDIR%/..
-	echo.
-	echo.Build finished; the PDF files are in %BUILDDIR%/latex.
-	goto end
-)
-
-if "%1" == "text" (
-	%SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
-	if errorlevel 1 exit /b 1
-	echo.
-	echo.Build finished. The text files are in %BUILDDIR%/text.
-	goto end
-)
-
-if "%1" == "man" (
-	%SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
-	if errorlevel 1 exit /b 1
-	echo.
-	echo.Build finished. The manual pages are in %BUILDDIR%/man.
-	goto end
-)
-
-if "%1" == "texinfo" (
-	%SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo
-	if errorlevel 1 exit /b 1
-	echo.
-	echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo.
-	goto end
-)
-
-if "%1" == "gettext" (
-	%SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale
-	if errorlevel 1 exit /b 1
-	echo.
-	echo.Build finished. The message catalogs are in %BUILDDIR%/locale.
-	goto end
-)
-
-if "%1" == "changes" (
-	%SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
-	if errorlevel 1 exit /b 1
-	echo.
-	echo.The overview file is in %BUILDDIR%/changes.
-	goto end
-)
-
-if "%1" == "linkcheck" (
-	%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
-	if errorlevel 1 exit /b 1
-	echo.
-	echo.Link check complete; look for any errors in the above output ^
-or in %BUILDDIR%/linkcheck/output.txt.
-	goto end
-)
-
-if "%1" == "doctest" (
-	%SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
-	if errorlevel 1 exit /b 1
-	echo.
-	echo.Testing of doctests in the sources finished, look at the ^
-results in %BUILDDIR%/doctest/output.txt.
-	goto end
-)
-
-if "%1" == "xml" (
-	%SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml
-	if errorlevel 1 exit /b 1
-	echo.
-	echo.Build finished. The XML files are in %BUILDDIR%/xml.
-	goto end
-)
-
-if "%1" == "pseudoxml" (
-	%SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml
-	if errorlevel 1 exit /b 1
-	echo.
-	echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml.
-	goto end
-)
-
-:end
--- a/testing/web-platform/tests/tools/wptrunner/docs/usage.rst
+++ b/testing/web-platform/tests/tools/wptrunner/docs/usage.rst
@@ -159,25 +159,25 @@ locations.
 The content of the ``wptrunner.default.ini`` default configuration file
 makes wptrunner look for tests (that is, a web-platform-tests checkout)
 as a subdirectory of the current directory named ``tests``, and for
 metadata files in a subdirectory of the current directory named ``meta``.
 
 Output
 ------
 
-wptrunner uses the :py:mod:`mozlog` package for output. This
+wptrunner uses [the `mozlog` package](https://firefox-source-docs.mozilla.org/mozbase/mozlog.html) for output. This
 structures events such as test results or log messages as JSON objects
 that can then be fed to other tools for interpretation. More details
-about the message format are given in the
-:py:mod:`mozlog` documentation.
+about the message format are given in [the
+`mozlog` documentation](https://firefox-source-docs.mozilla.org/mozbase/mozlog.html).
 
 By default the raw JSON messages are dumped to stdout. This is
 convenient for piping into other tools, but not ideal for humans
-reading the output. :py:mod:`mozlog` comes with several other
+reading the output. [`mozlog`](https://firefox-source-docs.mozilla.org/mozbase/mozlog.html) comes with several other
 formatters, which are accessible through command line options. The
 general format of these options is ``--log-name=dest``, where ``name``
 is the name of the format and ``dest`` is a path to a destination
 file, or ``-`` for stdout. The raw JSON data is written by the ``raw``
 formatter so, the default setup corresponds to ``--log-raw=-``.
 
 A reasonable output format for humans is provided as ``mach``. So in
 order to output the full raw log to a file and a human-readable
--- a/testing/web-platform/tests/tools/wptrunner/wptrunner/browsers/base.py
+++ b/testing/web-platform/tests/tools/wptrunner/wptrunner/browsers/base.py
@@ -107,31 +107,31 @@ def browser_command(binary, args, debug_
     return debug_args, command
 
 
 class BrowserError(Exception):
     pass
 
 
 class Browser(object):
+    """Abstract class serving as the basis for Browser implementations.
+
+    The Browser is used in the TestRunnerManager to start and stop the browser
+    process, and to check the state of that process. This class also acts as a
+    context manager, enabling it to do browser-specific setup at the start of
+    the testrun and cleanup after the run is complete.
+
+    :param logger: Structured logger to use for output.
+    """
     __metaclass__ = ABCMeta
 
     process_cls = None
     init_timeout = 30
 
     def __init__(self, logger):
-        """Abstract class serving as the basis for Browser implementations.
-
-        The Browser is used in the TestRunnerManager to start and stop the browser
-        process, and to check the state of that process. This class also acts as a
-        context manager, enabling it to do browser-specific setup at the start of
-        the testrun and cleanup after the run is complete.
-
-        :param logger: Structured logger to use for output.
-        """
         self.logger = logger
 
     def __enter__(self):
         self.setup()
         return self
 
     def __exit__(self, *args, **kwargs):
         self.cleanup()
@@ -201,19 +201,19 @@ class NullBrowser(Browser):
     def is_alive(self):
         return True
 
     def on_output(self, line):
         raise NotImplementedError
 
 
 class ExecutorBrowser(object):
-    def __init__(self, **kwargs):
-        """View of the Browser used by the Executor object.
-        This is needed because the Executor runs in a child process and
-        we can't ship Browser instances between processes on Windows.
+    """View of the Browser used by the Executor object.
+    This is needed because the Executor runs in a child process and
+    we can't ship Browser instances between processes on Windows.
 
-        Typically this will have a few product-specific properties set,
-        but in some cases it may have more elaborate methods for setting
-        up the browser from the runner process.
-        """
+    Typically this will have a few product-specific properties set,
+    but in some cases it may have more elaborate methods for setting
+    up the browser from the runner process.
+    """
+    def __init__(self, **kwargs):
         for k, v in kwargs.iteritems():
             setattr(self, k, v)
--- a/testing/web-platform/tests/tools/wptrunner/wptrunner/environment.py
+++ b/testing/web-platform/tests/tools/wptrunner/wptrunner/environment.py
@@ -45,19 +45,19 @@ def serve_path(test_paths):
     return test_paths["/"]["tests_path"]
 
 
 class TestEnvironmentError(Exception):
     pass
 
 
 class TestEnvironment(object):
+    """Context manager that owns the test environment i.e. the http and
+    websockets servers"""
     def __init__(self, test_paths, testharness_timeout_multipler, pause_after_test, debug_info, options, ssl_config, env_extras):
-        """Context manager that owns the test environment i.e. the http and
-        websockets servers"""
         self.test_paths = test_paths
         self.server = None
         self.config_ctx = None
         self.config = None
         self.testharness_timeout_multipler = testharness_timeout_multipler
         self.pause_after_test = pause_after_test
         self.test_server_port = options.pop("test_server_port", True)
         self.debug_info = debug_info
--- a/testing/web-platform/tests/tools/wptrunner/wptrunner/executors/base.py
+++ b/testing/web-platform/tests/tools/wptrunner/wptrunner/executors/base.py
@@ -124,36 +124,36 @@ def pytest_result_converter(self, test, 
 
 class ExecutorException(Exception):
     def __init__(self, status, message):
         self.status = status
         self.message = message
 
 
 class TestExecutor(object):
+    """Abstract Base class for object that actually executes the tests in a
+    specific browser. Typically there will be a different TestExecutor
+    subclass for each test type and method of executing tests.
+
+    :param browser: ExecutorBrowser instance providing properties of the
+                    browser that will be tested.
+    :param server_config: Dictionary of wptserve server configuration of the
+                          form stored in TestEnvironment.config
+    :param timeout_multiplier: Multiplier relative to base timeout to use
+                               when setting test timeout.
+    """
     __metaclass__ = ABCMeta
 
     test_type = None
     convert_result = None
     supports_testdriver = False
     supports_jsshell = False
 
     def __init__(self, browser, server_config, timeout_multiplier=1,
                  debug_info=None, **kwargs):
-        """Abstract Base class for object that actually executes the tests in a
-        specific browser. Typically there will be a different TestExecutor
-        subclass for each test type and method of executing tests.
-
-        :param browser: ExecutorBrowser instance providing properties of the
-                        browser that will be tested.
-        :param server_config: Dictionary of wptserve server configuration of the
-                              form stored in TestEnvironment.config
-        :param timeout_multiplier: Multiplier relative to base timeout to use
-                                   when setting test timeout.
-        """
         self.runner = None
         self.browser = browser
         self.server_config = server_config
         self.timeout_multiplier = timeout_multiplier
         self.debug_info = debug_info
         self.last_environment = {"protocol": "http",
                                  "prefs": {}}
         self.protocol = None  # This must be set in subclasses
--- a/testing/web-platform/tests/tools/wptrunner/wptrunner/testloader.py
+++ b/testing/web-platform/tests/tools/wptrunner/wptrunner/testloader.py
@@ -64,16 +64,18 @@ class DirectoryHashChunker(TestChunker):
         chunk_index = self.chunk_number - 1
         for test_type, test_path, tests in manifest:
             h = int(hashlib.md5(os.path.dirname(test_path)).hexdigest(), 16)
             if h % self.total_chunks == chunk_index:
                 yield test_type, test_path, tests
 
 
 class TestFilter(object):
+    """Callable that restricts the set of tests in a given manifest according
+    to initial criteria"""
     def __init__(self, test_manifests, include=None, exclude=None, manifest_path=None, explicit=False):
         if manifest_path is None or include or explicit:
             self.manifest = manifestinclude.IncludeManifest.create()
             self.manifest.set_defaults()
         else:
             self.manifest = manifestinclude.get_manifest(manifest_path)
 
         if include or explicit:
@@ -142,16 +144,17 @@ class ManifestLoader(object):
 def iterfilter(filters, iter):
     for f in filters:
         iter = f(iter)
     for item in iter:
         yield item
 
 
 class TestLoader(object):
+    """Loads tests according to a WPT manifest and any associated expectation files"""
     def __init__(self,
                  test_manifests,
                  test_types,
                  run_info,
                  manifest_filters=None,
                  chunk_type="none",
                  total_chunks=1,
                  chunk_number=1,
--- a/testing/web-platform/tests/tools/wptrunner/wptrunner/testrunner.py
+++ b/testing/web-platform/tests/tools/wptrunner/wptrunner/testrunner.py
@@ -46,29 +46,29 @@ def _log_func(level_name):
     return log
 
 # Create all the methods on StructuredLog for debug levels
 for level_name in structuredlog.log_levels:
     setattr(MessageLogger, level_name.lower(), _log_func(level_name))
 
 
 class TestRunner(object):
-    def __init__(self, logger, command_queue, result_queue, executor):
-        """Class implementing the main loop for running tests.
+    """Class implementing the main loop for running tests.
 
-        This class delegates the job of actually running a test to the executor
-        that is passed in.
+    This class delegates the job of actually running a test to the executor
+    that is passed in.
 
-        :param logger: Structured logger
-        :param command_queue: subprocess.Queue used to send commands to the
-                              process
-        :param result_queue: subprocess.Queue used to send results to the
-                             parent TestRunnerManager process
-        :param executor: TestExecutor object that will actually run a test.
-        """
+    :param logger: Structured logger
+    :param command_queue: subprocess.Queue used to send commands to the
+                          process
+    :param result_queue: subprocess.Queue used to send results to the
+                         parent TestRunnerManager process
+    :param executor: TestExecutor object that will actually run a test.
+    """
+    def __init__(self, logger, command_queue, result_queue, executor):
         self.command_queue = command_queue
         self.result_queue = result_queue
 
         self.executor = executor
         self.name = current_process().name
         self.logger = logger
 
     def __enter__(self):
@@ -768,26 +768,26 @@ def make_test_queue(tests, test_source_c
     # before the tests have been written to the underlying pipe.
     # Polling the pipe for data here avoids that
     queue._reader.poll(10)
     assert not queue.empty()
     return queue
 
 
 class ManagerGroup(object):
+    """Main thread object that owns all the TestRunnerManager threads."""
     def __init__(self, suite_name, size, test_source_cls, test_source_kwargs,
                  browser_cls, browser_kwargs,
                  executor_cls, executor_kwargs,
                  rerun=1,
                  pause_after_test=False,
                  pause_on_unexpected=False,
                  restart_on_unexpected=True,
                  debug_info=None,
                  capture_stdio=True):
-        """Main thread object that owns all the TestRunnerManager threads."""
         self.suite_name = suite_name
         self.size = size
         self.test_source_cls = test_source_cls
         self.test_source_kwargs = test_source_kwargs
         self.browser_cls = browser_cls
         self.browser_kwargs = browser_kwargs
         self.executor_cls = executor_cls
         self.executor_kwargs = executor_kwargs
--- a/testing/web-platform/tests/tools/wptrunner/wptrunner/wptrunner.py
+++ b/testing/web-platform/tests/tools/wptrunner/wptrunner/wptrunner.py
@@ -129,16 +129,18 @@ def get_pause_after_test(test_loader, **
             return False
         if kwargs["repeat"] == 1 and kwargs["rerun"] == 1 and total_tests == 1:
             return True
         return False
     return kwargs["pause_after_test"]
 
 
 def run_tests(config, test_paths, product, **kwargs):
+    """Set up the test environment, load the list of tests to be executed, and
+    invoke the remainder of the code to execute tests"""
     with capture.CaptureIO(logger, not kwargs["no_capture_stdio"]):
         env.do_delayed_imports(logger, test_paths)
 
         product = products.load_product(config, product, load_cls=True)
 
         env_extras = product.get_env_extras(**kwargs)
 
         product.check_args(**kwargs)