summaryrefslogtreecommitdiff
path: root/fpdfsdk/pwl/cpwl_edit_embeddertest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/pwl/cpwl_edit_embeddertest.cpp')
-rw-r--r--fpdfsdk/pwl/cpwl_edit_embeddertest.cpp48
1 files changed, 48 insertions, 0 deletions
diff --git a/fpdfsdk/pwl/cpwl_edit_embeddertest.cpp b/fpdfsdk/pwl/cpwl_edit_embeddertest.cpp
index 3574de9345..b3f0d5dc0e 100644
--- a/fpdfsdk/pwl/cpwl_edit_embeddertest.cpp
+++ b/fpdfsdk/pwl/cpwl_edit_embeddertest.cpp
@@ -371,3 +371,51 @@ TEST_F(CPWLEditEmbeddertest,
GetCPWLEdit()->ReplaceSelection(L"Hippopotamus");
EXPECT_STREQ(L"ElepHippop", GetCPWLEdit()->GetText().c_str());
}
+
+TEST_F(CPWLEditEmbeddertest, SetTextWithEndCarriageFeed) {
+ FormFillerAndWindowSetup(GetCPDFSDKAnnot());
+ GetCPWLEdit()->SetText(L"Foo\r");
+ EXPECT_STREQ(L"Foo", GetCPWLEdit()->GetText().c_str());
+}
+
+TEST_F(CPWLEditEmbeddertest, SetTextWithEndNewline) {
+ FormFillerAndWindowSetup(GetCPDFSDKAnnot());
+ GetCPWLEdit()->SetText(L"Foo\n");
+ EXPECT_STREQ(L"Foo", GetCPWLEdit()->GetText().c_str());
+}
+
+TEST_F(CPWLEditEmbeddertest, SetTextWithEndCarriageFeedAndNewLine) {
+ FormFillerAndWindowSetup(GetCPDFSDKAnnot());
+ GetCPWLEdit()->SetText(L"Foo\r\n");
+ EXPECT_STREQ(L"Foo", GetCPWLEdit()->GetText().c_str());
+}
+
+TEST_F(CPWLEditEmbeddertest, SetTextWithEndNewLineAndCarriageFeed) {
+ FormFillerAndWindowSetup(GetCPDFSDKAnnot());
+ GetCPWLEdit()->SetText(L"Foo\n\r");
+ EXPECT_STREQ(L"Foo", GetCPWLEdit()->GetText().c_str());
+}
+
+TEST_F(CPWLEditEmbeddertest, SetTextWithBodyCarriageFeed) {
+ FormFillerAndWindowSetup(GetCPDFSDKAnnot());
+ GetCPWLEdit()->SetText(L"Foo\rBar");
+ EXPECT_STREQ(L"FooBar", GetCPWLEdit()->GetText().c_str());
+}
+
+TEST_F(CPWLEditEmbeddertest, SetTextWithBodyNewline) {
+ FormFillerAndWindowSetup(GetCPDFSDKAnnot());
+ GetCPWLEdit()->SetText(L"Foo\nBar");
+ EXPECT_STREQ(L"FooBar", GetCPWLEdit()->GetText().c_str());
+}
+
+TEST_F(CPWLEditEmbeddertest, SetTextWithBodyCarriageFeedAndNewLine) {
+ FormFillerAndWindowSetup(GetCPDFSDKAnnot());
+ GetCPWLEdit()->SetText(L"Foo\r\nBar");
+ EXPECT_STREQ(L"FooBar", GetCPWLEdit()->GetText().c_str());
+}
+
+TEST_F(CPWLEditEmbeddertest, SetTextWithBodyNewLineAndCarriageFeed) {
+ FormFillerAndWindowSetup(GetCPDFSDKAnnot());
+ GetCPWLEdit()->SetText(L"Foo\n\rBar");
+ EXPECT_STREQ(L"FooBar", GetCPWLEdit()->GetText().c_str());
+}