michael@0: /* vim: set ts=2 et sw=2 tw=80: */ michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: const TESTCASE_URI = TEST_BASE_HTTPS + "simple.html"; michael@0: const NEW_URI = TEST_BASE_HTTPS + "media.html"; michael@0: michael@0: const LINE_NO = 5; michael@0: const COL_NO = 0; michael@0: michael@0: let gContentWin; michael@0: let gUI; michael@0: michael@0: function test() michael@0: { michael@0: waitForExplicitFinish(); michael@0: michael@0: addTabAndOpenStyleEditors(2, function(panel) { michael@0: gContentWin = gBrowser.selectedTab.linkedBrowser.contentWindow.wrappedJSObject; michael@0: gUI = panel.UI; michael@0: gUI.editors[0].getSourceEditor().then(runTests); michael@0: }); michael@0: michael@0: content.location = TESTCASE_URI; michael@0: } michael@0: michael@0: function runTests() michael@0: { michael@0: let count = 0; michael@0: michael@0: // Make sure Editor doesn't go into an infinite loop when michael@0: // column isn't passed. See bug 941018. michael@0: gUI.once("editor-selected", (event, editor) => { michael@0: editor.getSourceEditor().then(() => { michael@0: is(gUI.selectedEditor, gUI.editors[1], "second editor is selected"); michael@0: let {line, ch} = gUI.selectedEditor.sourceEditor.getCursor(); michael@0: michael@0: is(line, LINE_NO, "correct line selected"); michael@0: is(ch, COL_NO, "correct column selected"); michael@0: michael@0: gUI = null; michael@0: finish(); michael@0: }); michael@0: }); michael@0: michael@0: gUI.selectStyleSheet(gUI.editors[1].styleSheet.href, LINE_NO); michael@0: }