mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 12:25:53 +00:00
Bug 947544 - Fix intermittent in the Shader Editor test browser_se_bfcache.js. r=vp
This commit is contained in:
parent
79c6767d01
commit
67903d3205
@ -10,19 +10,18 @@ function ifWebGLSupported() {
|
||||
let { gFront, $, EVENTS, ShadersListView, ShadersEditorsView } = panel.panelWin;
|
||||
|
||||
let reloaded = reload(target);
|
||||
let firstProgram = yield once(gFront, "program-linked");
|
||||
yield once(gFront, "program-linked");
|
||||
yield reloaded;
|
||||
|
||||
let navigated = navigate(target, MULTIPLE_CONTEXTS_URL);
|
||||
let [secondProgram, thirdProgram] = yield getPrograms(gFront, 2);
|
||||
yield getPrograms(gFront, 2);
|
||||
yield navigated;
|
||||
|
||||
let vsEditor = yield ShadersEditorsView._getEditor("vs");
|
||||
let fsEditor = yield ShadersEditorsView._getEditor("fs");
|
||||
|
||||
yield navigateInHistory(target, "back", "will-navigate");
|
||||
yield once(panel.panelWin, EVENTS.PROGRAMS_ADDED);
|
||||
yield once(panel.panelWin, EVENTS.SOURCES_SHOWN);
|
||||
yield waitForSources();
|
||||
|
||||
is($("#content").hidden, false,
|
||||
"The tool's content should not be hidden.");
|
||||
@ -37,8 +36,7 @@ function ifWebGLSupported() {
|
||||
"The fragment shader editor contains the correct text.");
|
||||
|
||||
yield navigateInHistory(target, "forward", "will-navigate");
|
||||
yield once(panel.panelWin, EVENTS.PROGRAMS_ADDED);
|
||||
yield once(panel.panelWin, EVENTS.SOURCES_SHOWN);
|
||||
yield waitForSources();
|
||||
|
||||
is($("#content").hidden, false,
|
||||
"The tool's content should not be hidden.");
|
||||
@ -54,4 +52,18 @@ function ifWebGLSupported() {
|
||||
|
||||
yield teardown(panel);
|
||||
finish();
|
||||
|
||||
function waitForSources() {
|
||||
let deferred = promise.defer();
|
||||
let win = panel.panelWin;
|
||||
// These events must fire in this in order and the second event fires
|
||||
// synchronously after the first event, so we can't use Promise.all and the
|
||||
// `once` helper.
|
||||
win.once(win.EVENTS.PROGRAMS_ADDED, () => {
|
||||
win.once(win.EVENTS.SOURCES_SHOWN, () => {
|
||||
deferred.resolve();
|
||||
});
|
||||
});
|
||||
return deferred.promise;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user