function testToggleComment(expectedCommentedText, expectedCommentedSel, expectedSelText, type) {
            var command = (type === "block" ? Commands.EDIT_BLOCK_COMMENT : Commands.EDIT_LINE_COMMENT);

            function expectSel(sel) {
                if (Array.isArray(sel)) {
                    expectSelections(sel);
                } else if (sel.start) {
                    expectSelection(sel);
                } else {
                    expectCursorAt(sel);
                }
            }

            // Toggle comment on
            CommandManager.execute(command, myEditor);
            expect(myDocument.getText()).toEqual(expectedCommentedText);
            expectSel(expectedCommentedSel);
            if (expectedSelText) {
                expect(myEditor.getSelectedText()).toEqual(expectedSelText);
            }
        }
Invokes Toggle Line or Block Comment, expects the given selection/cursor & document text
@param {!string} expectedCommentedText
@param {!{ch:number,line:number}|{start:{ch:number,line:number},end:{ch:number,line:number}}} expectedCommentedSel
@param {?string} expectedSelText If provided, the text that should be selected after the first comment operation.
@param {!string} type Either "block" or "line".