Bug 1225864 - New flag OutputDisallowLineBreaking to disallow line breaking. Test. r=masayuki

This commit is contained in:
Jorg K 2015-11-27 06:19:00 +01:00
parent 7034fa9aff
commit b366fdfc09

View File

@ -94,6 +94,42 @@ TestCJKWithFlowedDelSp()
return NS_OK;
}
// Test for CJK with DisallowLineBreaking
nsresult
TestCJKWithDisallowLineBreaking()
{
nsString test;
nsString result;
test.AssignLiteral("<html><body>");
for (uint32_t i = 0; i < 400; i++) {
// Insert Kanji (U+5341)
test.Append(0x5341);
}
test.AppendLiteral("</body></html>");
ConvertBufToPlainText(test, nsIDocumentEncoder::OutputFormatted |
nsIDocumentEncoder::OutputCRLineBreak |
nsIDocumentEncoder::OutputLFLineBreak |
nsIDocumentEncoder::OutputFormatFlowed |
nsIDocumentEncoder::OutputDisallowLineBreaking);
// create result case
for (uint32_t i = 0; i < 400; i++) {
result.Append(0x5341);
}
result.AppendLiteral("\r\n");
if (!test.Equals(result)) {
fail("Wrong HTML to CJK text serialization with OutputDisallowLineBreaking");
return NS_ERROR_FAILURE;
}
passed("HTML to CJK text serialization with OutputDisallowLineBreaking");
return NS_OK;
}
nsresult
TestPrettyPrintedHtml()
{
@ -228,6 +264,9 @@ TestPlainTextSerializer()
rv = TestPreWrapElementForThunderbird();
NS_ENSURE_SUCCESS(rv, rv);
rv = TestCJKWithDisallowLineBreaking();
NS_ENSURE_SUCCESS(rv, rv);
// Add new tests here...
return NS_OK;
}