Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
1 /* vim: set ts=2 et sw=2 tw=80: */
2 /* Any copyright is dedicated to the Public Domain.
3 http://creativecommons.org/publicdomain/zero/1.0/ */
5 const TESTCASE_URI = TEST_BASE_HTTPS + "simple.html";
6 const NEW_URI = TEST_BASE_HTTPS + "media.html";
8 const LINE_NO = 5;
9 const COL_NO = 0;
11 let gContentWin;
12 let gUI;
14 function test()
15 {
16 waitForExplicitFinish();
18 addTabAndOpenStyleEditors(2, function(panel) {
19 gContentWin = gBrowser.selectedTab.linkedBrowser.contentWindow.wrappedJSObject;
20 gUI = panel.UI;
21 gUI.editors[0].getSourceEditor().then(runTests);
22 });
24 content.location = TESTCASE_URI;
25 }
27 function runTests()
28 {
29 let count = 0;
31 // Make sure Editor doesn't go into an infinite loop when
32 // column isn't passed. See bug 941018.
33 gUI.once("editor-selected", (event, editor) => {
34 editor.getSourceEditor().then(() => {
35 is(gUI.selectedEditor, gUI.editors[1], "second editor is selected");
36 let {line, ch} = gUI.selectedEditor.sourceEditor.getCursor();
38 is(line, LINE_NO, "correct line selected");
39 is(ch, COL_NO, "correct column selected");
41 gUI = null;
42 finish();
43 });
44 });
46 gUI.selectStyleSheet(gUI.editors[1].styleSheet.href, LINE_NO);
47 }