diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /devtools/client/shadereditor/test/browser_se_bfcache.js | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'devtools/client/shadereditor/test/browser_se_bfcache.js')
-rw-r--r-- | devtools/client/shadereditor/test/browser_se_bfcache.js | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/devtools/client/shadereditor/test/browser_se_bfcache.js b/devtools/client/shadereditor/test/browser_se_bfcache.js new file mode 100644 index 000000000..2b568e3fe --- /dev/null +++ b/devtools/client/shadereditor/test/browser_se_bfcache.js @@ -0,0 +1,60 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +/** + * Tests if the shader editor works with bfcache. + */ +function* ifWebGLSupported() { + let { target, panel } = yield initShaderEditor(SIMPLE_CANVAS_URL); + let { gFront, $, EVENTS, ShadersListView, ShadersEditorsView } = panel.panelWin; + + // Attach frame scripts if in e10s to perform + // history navigation via the content + loadFrameScripts(); + + let reloaded = reload(target); + let firstProgram = yield once(gFront, "program-linked"); + yield reloaded; + + let navigated = navigate(target, MULTIPLE_CONTEXTS_URL); + let [secondProgram, thirdProgram] = 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); + + is($("#content").hidden, false, + "The tool's content should not be hidden."); + is(ShadersListView.itemCount, 1, + "The shaders list contains one entry after navigating back."); + is(ShadersListView.selectedIndex, 0, + "The shaders list has a correct selection after navigating back."); + + is(vsEditor.getText().indexOf("gl_Position"), 170, + "The vertex shader editor contains the correct text."); + is(fsEditor.getText().indexOf("gl_FragColor"), 97, + "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); + + is($("#content").hidden, false, + "The tool's content should not be hidden."); + is(ShadersListView.itemCount, 2, + "The shaders list contains two entries after navigating forward."); + is(ShadersListView.selectedIndex, 0, + "The shaders list has a correct selection after navigating forward."); + + is(vsEditor.getText().indexOf("gl_Position"), 100, + "The vertex shader editor contains the correct text."); + is(fsEditor.getText().indexOf("gl_FragColor"), 89, + "The fragment shader editor contains the correct text."); + + yield teardown(panel); + finish(); +} |