зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
c0923e6186
Коммит
e27f8cd92f
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче