tagonenterhandler_test.js
No description.

File Location

/goog/editor/plugins/tagonenterhandler_test.js


Public Protected Private

Global Functions

assertPreparedContents()
Assert that the prepared contents matches the expected.
code »
helpTestSplit_(offsetfirstHalfStringsecondHalfStringisAppendopt_goToRoot)
Runs a test for splitting the dom.
Arguments:
offset : number
Index into the text node to split.
firstHalfString : string
What the html of the first half of the DOM should be.
secondHalfString : string
What the html of the 2nd half of the DOM should be.
isAppend : boolean
True if the second half should be appended to the DOM.
opt_goToRoot : boolean=
True if the root argument for splitDom should be excluded.
code »
makeField(idopt_tag) goog.editor.Field
Creates a field with only the enter handler plugged in, for testing.
Arguments:
id : string
A DOM id.
opt_tag : boolean=
The block tag to use. Defaults to P.
Returns: goog.editor.Field  A field.
code »
selectNodeAndHitEnter(fieldid) boolean
Selects the node at the given id, and simulates an ENTER keypress.
Arguments:
field : googe.editor.Field
The field with the node.
id : string
A DOM id.
Returns: boolean  Whether preventDefault was called on the event.
code »
setUp()
No description.
code »
splitDomCases_(testFn)
Runs different cases of splitting the DOM.
Arguments:
testFn : function(number, string, string)
Function that takes an offset, firstHalfString and secondHalfString as parameters.
code »
testDeleteBrBeforeBlock()
Tests that deleting a BR that comes right before a block element works.
code »
testDeleteBrNormal()
Tests that deleting a BR is working normally (that the workaround for the bug is not causing double deletes).
code »
testEnterAtBeginningOfLink()
Verifies goog.editor.plugins.TagOnEnterHandler.prototype.handleRegularEnterGecko_ when we explicitly split anchor elements. This test runs only for Gecko since this is a Gecko-only codepath.
code »
testEnterCreatesBlankLine()
Regression test for http://b/1991234 . Tests that when you hit enter and it creates a blank line with whitespace and a BR, the cursor is placed in the whitespace text node instead of the BR, otherwise continuing to type will create adjacent text nodes, which causes browsers to mess up some execcommands. Fix is in a Gecko-only codepath, thus test runs only for Gecko. A full test for the entire sequence that reproed the bug is in javascript/apps/editor/tests/ponenter_robot.html .
code »
testEnterInEmptyListItemAtBeginningOfList()
No description.
code »
testEnterInEmptyListItemAtBeginningOfSublist()
No description.
code »
testEnterInEmptyListItemAtEndOfList()
No description.
code »
testEnterInEmptyListItemAtEndOfSublist()
No description.
code »
testEnterInEmptyListItemInEmptyList()
Verifies correct handling of pressing enter in an empty list item.
code »
testEnterInEmptyListItemInMiddleOfList()
No description.
code »
testEnterInEmptyListItemInSublist()
No description.
code »
testEnterNormalizeNodes()
Regression test for http://b/3051179 . Tests that when you hit enter and it creates a blank line with a BR and the cursor is placed in P. Splitting DOM causes to make an empty text node. Then if the cursor is placed at the text node the cursor is shown at wrong location. Therefore this test checks that the cursor is not placed at an empty node. Fix is in a Gecko-only codepath, thus test runs only for Gecko.
code »
testPrepareContentForDivOnEnter()
No description.
code »
testPrepareContentForPOnEnter()
No description.
code »
testReplaceWhiteSpaceWithNbsp()
No description.
code »
testSplitDom()
No description.
code »
testSplitDomAndAppend()
No description.
code »
testSplitDomAtChildlessElement()
No description.
code »
testSplitDomAtElement()
No description.
code »
testSplitDomAtElementStart()
No description.
code »

Global Variables

editor :
No description.
Code »
No description.
Code »

Directory plugins

File Reference