bug 1570378: remote: add bc test helper setup() for empty documents r=remote-protocol-reviewers,jdescottes

For many browser-chrome (bc) tests is does not matter what the
document is, as long as it is does not cause state to bleed over
from the previous test.

For these cases this patch introduces a shorthand, setup(), which
calls setupForURL(url) with an empty document generated by toDataURL("").

Differential Revision: https://phabricator.services.mozilla.com/D40216

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Andreas Tolfsen 2019-08-02 16:29:35 +00:00
Родитель c0923e6186
Коммит e27f8cd92f
4 изменённых файлов: 11 добавлений и 3 удалений

Просмотреть файл

@ -7,7 +7,7 @@
// See also browser_runtime_evaluate, which covers basic usages of this method.
add_task(async function() {
const { client } = await setupForURL(toDataURL(""));
const { client } = await setup();
const firstContext = await testRuntimeEnable(client);
const contextId = firstContext.id;

Просмотреть файл

@ -6,7 +6,7 @@
// Test the Runtime remote object
add_task(async function() {
const { client } = await setupForURL(toDataURL(""));
const { client } = await setup();
const firstContext = await testRuntimeEnable(client);
const contextId = firstContext.id;

Просмотреть файл

@ -6,7 +6,7 @@
// Test the Runtime remote object
add_task(async function() {
const { client } = await setupForURL(toDataURL(""));
const { client } = await setup();
const firstContext = await testRuntimeEnable(client);
const contextId = firstContext.id;

Просмотреть файл

@ -101,6 +101,14 @@ function getTargets(CDP) {
});
}
/**
* Set up test environment in same fashion as setupForURL(),
* except using an empty document.
*/
async function setup() {
return setupForURL(toDataURL(""));
}
/**
* Set up test environment by starting the remote agent, connecting
* the CDP client over loopback, and creating a fresh tab to avoid