blob: 2c3e07508756468fd622afe59f9c54a1297a0b60 [file] [log] [blame]
Tests queryCommandState('justifyCenter'), queryCommandState('justifyFull'), queryCommandState('justifyLeft'), and queryCommandState('justifyRight')
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
Caret
PASS queryCommand('format') returns "" when selecting no selection on of "hello"
PASS queryCommand('format') returns "left" when selecting first position of "hello"
PASS queryCommand('format') returns "left" when selecting first position of "<p>hello</p>"
PASS queryCommand('format') returns "center" when selecting first position of "<p align="center">hello</p>"
PASS queryCommand('format') returns "full" when selecting first position of "<p align="justify">hello</p>"
PASS queryCommand('format') returns "left" when selecting first position of "<p align="left">hello</p>"
PASS queryCommand('format') returns "right" when selecting first position of "<p align="right">hello</p>"
PASS queryCommand('format') returns "center" when selecting first position of "<p style="text-align: center;">hello</p>"
PASS queryCommand('format') returns "full" when selecting first position of "<p style="text-align: justify;">hello</p>"
PASS queryCommand('format') returns "left" when selecting first position of "<p style="text-align: left;">hello</p>"
PASS queryCommand('format') returns "right" when selecting first position of "<p style="text-align: right;">hello</p>"
PASS queryCommand('format') returns "full" when selecting first position of "<p align="center" style="text-align: justify;">hello</p>"
PASS queryCommand('format') returns "left" when selecting first position of "<p align="right" style="text-align: left;">hello</p>"
PASS queryCommand('format') returns "right" when selecting first position of "<p align="center" style="text-align: right;">hello</p>"
PASS queryCommand('format') returns "center" when selecting first position of "<p align="left" style="text-align: center;">hello</p>"
PASS queryCommand('format') returns "left" when selecting first position of "<p align="right" style="text-align: left;">hello</p>"
PASS queryCommand('format') returns "right" when selecting first position of "<p align="center" style="text-align: right;">hello</p>"
PASS queryCommand('format') returns "center" when selecting first position of "<p align="left" style="text-align: center;">hello</p>"
PASS queryCommand('format') returns "left" when selecting first position of "<h1>hello</h1>"
PASS queryCommand('format') returns "center" when selecting first position of "<h1 align="center">hello</h1>"
PASS queryCommand('format') returns "full" when selecting first position of "<h1 align="justify">hello</h1>"
PASS queryCommand('format') returns "left" when selecting first position of "<h2 align="left">hello</h2>"
PASS queryCommand('format') returns "right" when selecting first position of "<h3 align="right">hello</h3>"
PASS queryCommand('format') returns "center" when selecting first position of "<h4 align="center">hello</h4>"
PASS queryCommand('format') returns "left" when selecting first position of "<h5 align="left">hello</h5>"
PASS queryCommand('format') returns "right" when selecting first position of "<h6 align="right">hello</h6>"
PASS queryCommand('format') returns "full" when selecting first position of "<div align="justify">hello</div>"
PASS queryCommand('format') returns "center" when selecting first position of "<div align="center">hello</div>"
PASS queryCommand('format') returns "left" when selecting first position of "<div align="left">hello</div>"
PASS queryCommand('format') returns "right" when selecting first position of "<div align="right">hello</div>"
Tests for win
PASS queryCommand('format') returns "left" when selecting middle of "<p>hello</p><p>world</p>"
PASS queryCommand('format') returns "" when selecting middle of "<p align="right">hello</p><p>world</p>"
PASS queryCommand('format') returns "left" when selecting middle of "<p>hello</p><p align="left">world</p>"
PASS queryCommand('format') returns "" when selecting middle of "<p align="left">hello</p><p align="right">world</p>"
PASS queryCommand('format') returns "center" when selecting middle of "<p align="center">hello</p><p align="center">world</p>"
PASS queryCommand('format') returns "full" when selecting middle of "<p align="justify">hello</p><p align="justify">world</p>"
PASS queryCommand('format') returns "left" when selecting middle of "<p align="left">hello</p><p align="left">world</p>"
PASS queryCommand('format') returns "right" when selecting middle of "<p align="right">hello</p><p align="right">world</p>"
PASS queryCommand('format') returns "" when selecting middle of "<div align="right">hello<p align="left">world</p></div>"
PASS queryCommand('format') returns "" when selecting middle of "<div align="left"><p align="center">world</p>hello</div>"
PASS queryCommand('format') returns "left" when selecting middle of "<p align="left">hello</p><p>w</p><p align="left">orld</p>"
PASS queryCommand('format') returns "" when selecting middle of "<p align="justify">hello</p><p>w</p><p align="center">orld</p>"
Tests for mac
PASS queryCommand('format') returns "left" when selecting middle of "<p>hello</p><p>world</p>"
PASS queryCommand('format') returns "right" when selecting middle of "<p align="right">hello</p><p>world</p>"
PASS queryCommand('format') returns "left" when selecting middle of "<p>hello</p><p align="left">world</p>"
PASS queryCommand('format') returns "left" when selecting middle of "<p align="left">hello</p><p align="right">world</p>"
PASS queryCommand('format') returns "center" when selecting middle of "<p align="center">hello</p><p align="center">world</p>"
PASS queryCommand('format') returns "full" when selecting middle of "<p align="justify">hello</p><p align="justify">world</p>"
PASS queryCommand('format') returns "left" when selecting middle of "<p align="left">hello</p><p align="left">world</p>"
PASS queryCommand('format') returns "right" when selecting middle of "<p align="right">hello</p><p align="right">world</p>"
PASS queryCommand('format') returns "right" when selecting middle of "<div align="right">hello<p align="left">world</p></div>"
PASS queryCommand('format') returns "center" when selecting middle of "<div align="left"><p align="center">world</p>hello</div>"
PASS queryCommand('format') returns "left" when selecting middle of "<p align="left">hello</p><p>w</p><p align="left">orld</p>"
PASS queryCommand('format') returns "full" when selecting middle of "<p align="justify">hello</p><p>w</p><p align="center">orld</p>"
PASS successfullyParsed is true
TEST COMPLETE