VulpesOS/gaia/tests/jsmarionette/client/marionette-client/test/integration/scope-test.js
OverSu b38dea0597 Publish Vulpes Preview 15 sources for desktop, Android and Tundra
Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
2026-09-30 23:13:03 +02:00

36 lines
745 B
JavaScript
Executable file

/* global assert */
'use strict';
require('../helper');
suite('scope', function() {
var client = marionette.client(),
helper = require('./helper'),
timeoutA,
timeoutB;
helper.skipInitialError(client);
setup(function() {
timeoutA = client.scope({ scriptTimeout: 1000 });
timeoutB = client.scope({ scriptTimeout: 250 });
});
test('should handle scope switching', function() {
function sleep() {
setTimeout(function() {
marionetteScriptFinished();
}, 600);
}
timeoutA.executeAsyncScript(sleep);
var err;
try {
timeoutB.executeAsyncScript(sleep);
} catch (e) {
err = e;
}
// sleep throws error on shorter timeout
assert.ok(err);
});
});