This document provides a rough evaluation of the coverage of the Presentation API test suite against the Presentation API specification [[!PRESENTATION-API]].

This document is only intended to be maintained while the Second Screen Presentation Working Group is busy assembling an implementation report to be able to publish the Presentation API specification as a Proposed Recommendation, circa end of 2016. Information in this document will quickly become obsolete afterwards.

Useful links

Proposed action plan

Milestones in this action plan were set in October 2016 and should now be considered obsolete. The actions items remain valid. Those done are flagged accordingly.

By end of October 2016

By end of November 2016

By mid-December 2016

Test coverage

Section Test(s) Covered
IDL harness tests are not shown in the table. These tests effectively check implementations against all WebIDL definitions that appear in the specification (presence of classes, constructors, attributes, types, etc.).

How to update the table

How to update the list of sections

To update the rows that compose the coverage table, run the following steps:

  1. Open the Presentation API specification in your favorite browser
  2. Run the following code in a console window to build the internal representation used to render the table above.
  3. Copy the result and paste it in the toc.js file in the same folder as the source of this document.
  4. Refresh this document.
// List of section titles to skip
// (because they don't contain testable assertions per se)
var sectionsToIgnore = [
  'Introduction',
  'Use cases and requirements',
  'Conformance',
  'Terminology',
  'Examples',
  'Common idioms',
  'Security and privacy considerations',
  'Acknowledgments',
  'CR exit criteria',
  'References',
  'Change log'
];


// Custom forEach function for querySelectorAll results
var forEach = function (array, callback, scope) {
  for (var i = 0; i < array.length; i++) {
    callback.call(scope, array[i], i);
  }
};


// Parse the table of contents and extract the sections of interest
var extractTocRecursively = function (tocEntry, section) {
  forEach(tocEntry.querySelectorAll('ol > li'), function (subTocEntry) {
    if (subTocEntry.parentNode.parentNode !== tocEntry) {
      return;
    }

    // Extract link and main title (skipping the section number in the "span")
    var link = subTocEntry.querySelector('a');
    var name = link.textContent.replace(/[\dA-Z]+(\.\s|(\.\d+)+)/, '').trim();
    if (sectionsToIgnore.includes(name)) {
      return;
    }

    var subSection = {
      number: link.firstChild.textContent.trim(),
      name: name,
      url: link.getAttribute('href').substring(1)
    };

    if (!section.children) {
      section.children = [];
    }
    section.children.push(subSection);
    extractTocRecursively(subTocEntry, subSection);
  });
};

var toc = { name: 'Table of Contents' };
extractTocRecursively(document.querySelector('#toc'), toc);

console.log(JSON.stringify(toc, null, 2));
        

How to update the list of tests

To update the list of tests and have them link to the section(s) of the specification that they check, edit the tests.js file that sits along the source of this document. Nothing magic there, that's all the result of a bit of elbow grease. A given test may check more than one section in the specification.

How to update the coverage info

To update the information displayed in the last column, edit the coverage.js file that sits along the source of this document. The keys of the coverage object are the ID of the sections, and the values are rough estimate of the test coverage in percent, or an object with a coverage key that sets the coverage percentage, a comments key that lists possible comments about the coverage (in an array of strings), and an assignee key that sets the person responsible for updating the test suite to cover the section.

If a section does not appear in the coverage object, a question mark will appear in the last column to indicate that coverage is unknown at this stage.