Closed Bug 1563533 Opened 5 years ago Closed 5 years ago

Introduce a document inlining function for browser chrome tests

Categories

(Remote Protocol :: Agent, enhancement, P1)

enhancement

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: ato, Assigned: ato)

References

Details

Attachments

(2 files)

The tests currently do a lot of this:

const TEST_URI = "data:text/html;charset=utf-8,default-test-page";
const OTHER_URI = "data:text/html;charset=utf-8,some-other-page";

We save ourselves the boilerplate (with the potential and occasional typo)
by having a shared function that lets us generate different types of inline documents.

There is prior art for this in both the WPT and Marionette test suites:
https://searchfox.org/mozilla-central/source/testing/web-platform/tests/webdriver/tests/support/inline.py#4

Priority: -- → P3
Blocks: 1563746
Assignee: nobody → ato
Status: NEW → ASSIGNED
Priority: P3 → P1

Introduces helper function, inline(), that takes a document extract
and produces a data URL with the necessary properties for Gecko to
recognise it as an HTML document with the correct media type.

This has the benefit that HTML fragments and tags such as < and > are
encoded correctly, which is an obvious safety-win, and subsequently
that documents can be created on-the-fly with minimal code.

It will be possible to extend this function for other document types,
such as XHTML, XML, and even binary formats, as needed in the future.

Some local adaptions have been made, but this is mostly functionally
equivalent.

Blocks: 1549708
Attachment #9081253 - Attachment description: bug 1563533: remote: add document inlining helpe; → bug 1563533: remote: add toDataURL document inlining helper;
Blocks: 1570378
Pushed by atolfsen@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f72466a9df1a
remote: add toDataURL document inlining helper; r=remote-protocol-reviewers,jdescottes
https://hg.mozilla.org/integration/autoland/rev/28f189acbe03
remote: update bc tests to use document inlining; r=remote-protocol-reviewers,jdescottes
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: