Bug 1119503 - Part 4: Add a test for serialization of block elements without style information; r=bzbarsky

This commit is contained in:
Ehsan Akhgari 2015-01-24 15:06:00 -05:00
Родитель b378354abd
Коммит 3f37e1a74e
1 изменённых файлов: 28 добавлений и 0 удалений

Просмотреть файл

@ -137,6 +137,31 @@ TestPreElement()
return NS_OK;
}
nsresult
TestBlockElement()
{
nsString test;
test.AppendLiteral(
"<html>" NS_LINEBREAK
"<body>" NS_LINEBREAK
"<div>" NS_LINEBREAK
" first" NS_LINEBREAK
"</div>" NS_LINEBREAK
"<div>" NS_LINEBREAK
" second" NS_LINEBREAK
"</div>" NS_LINEBREAK
"</body>" NS_LINEBREAK "</html>");
ConvertBufToPlainText(test, 0);
if (!test.EqualsLiteral("first" NS_LINEBREAK "second" NS_LINEBREAK)) {
fail("Wrong prettyprinted html to text serialization");
return NS_ERROR_FAILURE;
}
passed("prettyprinted HTML to text serialization test");
return NS_OK;
}
nsresult
TestPlainTextSerializer()
{
@ -163,6 +188,9 @@ TestPlainTextSerializer()
rv = TestPreElement();
NS_ENSURE_SUCCESS(rv, rv);
rv = TestBlockElement();
NS_ENSURE_SUCCESS(rv, rv);
// Add new tests here...
return NS_OK;
}