Bug 1404946 - Rename wait module to sync. r=whimboo

testing/marionette/wait.js originally contained a utility for
poll-waiting on a condition.  The module has since been expanded to
also include TimedPromise, which is a specialisation of Promise that
is rejected after a duration.

The latter is not a wait utility but a synchronisation primitive.
This terminology also covers the first, and this change renames the
wait module to sync.

MozReview-Commit-ID: Fd3LqfpiEaU

--HG--
rename : testing/marionette/wait.js => testing/marionette/sync.js
extra : rebase_source : 5e22ec5e26b5405c928ab26734a8d2ddc5d43785
This commit is contained in:
Andreas Tolfsen 2017-10-02 16:38:33 +01:00
Родитель e0ca72f574
Коммит 583c91fabd
6 изменённых файлов: 9 добавлений и 7 удалений

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

@ -47,7 +47,7 @@ Cu.import("chrome://marionette/content/modal.js");
Cu.import("chrome://marionette/content/proxy.js");
Cu.import("chrome://marionette/content/reftest.js");
Cu.import("chrome://marionette/content/session.js");
const {wait, TimedPromise} = Cu.import("chrome://marionette/content/wait.js", {});
const {wait, TimedPromise} = Cu.import("chrome://marionette/content/sync.js", {});
Cu.importGlobalProperties(["URL"]);

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

@ -15,7 +15,7 @@ const {
pprint,
StaleElementReferenceError,
} = Cu.import("chrome://marionette/content/error.js", {});
Cu.import("chrome://marionette/content/wait.js");
Cu.import("chrome://marionette/content/sync.js");
this.EXPORTED_SYMBOLS = ["element"];

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

@ -17,7 +17,7 @@ marionette.jar:
content/cert.js (cert.js)
content/event.js (event.js)
content/error.js (error.js)
content/wait.js (wait.js)
content/sync.js (sync.js)
content/message.js (message.js)
content/modal.js (modal.js)
content/proxy.js (proxy.js)

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

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

@ -4,7 +4,9 @@
const {utils: Cu} = Components;
Cu.import("chrome://marionette/content/wait.js");
Cu.import("chrome://marionette/content/sync.js");
const DEFAULT_TIMEOUT = 2000;
add_task(async function test_until_types() {
for (let typ of [true, false, "foo", 42, [], {}]) {
@ -20,7 +22,7 @@ add_task(async function test_until_timeoutElapse() {
reject();
});
let end = new Date().getTime();
greaterOrEqual((end - start), 2000);
greaterOrEqual((end - start), DEFAULT_TIMEOUT);
greaterOrEqual(nevals, 15);
});
@ -49,7 +51,7 @@ add_task(async function test_until_noTimeout() {
}, 0);
let end = new Date().getTime();
equal(1, nevals);
less((end - start), 2000);
less((end - start), DEFAULT_TIMEOUT);
});
add_task(async function test_until_timeout() {

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

@ -16,4 +16,4 @@ skip-if = appname == "thunderbird"
[test_message.js]
[test_navigate.js]
[test_session.js]
[test_wait.js]
[test_sync.js]