OLD | NEW |
1 // Copyright 2015 PDFium Authors. All rights reserved. | 1 // Copyright 2015 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "../../public/fpdf_formfill.h" | 5 #include "../../public/fpdf_formfill.h" |
6 #include "../../testing/embedder_test.h" | 6 #include "../../testing/embedder_test.h" |
7 #include "../../testing/embedder_test_mock_delegate.h" | 7 #include "../../testing/embedder_test_mock_delegate.h" |
8 #include "../../testing/embedder_test_timer_handling_delegate.h" | 8 #include "../../testing/embedder_test_timer_handling_delegate.h" |
9 #include "../../testing/test_support.h" | |
10 #include "testing/gmock/include/gmock/gmock.h" | 9 #include "testing/gmock/include/gmock/gmock.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
12 | 11 |
13 using testing::_; | 12 using testing::_; |
14 using testing::Return; | 13 using testing::Return; |
15 | 14 |
16 class FPDFFormFillEmbeddertest : public EmbedderTest {}; | 15 class FPDFFormFillEmbeddertest : public EmbedderTest {}; |
17 | 16 |
18 TEST_F(FPDFFormFillEmbeddertest, FirstTest) { | 17 TEST_F(FPDFFormFillEmbeddertest, FirstTest) { |
19 EmbedderTestMockDelegate mock; | 18 EmbedderTestMockDelegate mock; |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 EXPECT_TRUE(OpenDocument("testing/resources/bug_551248.pdf")); | 71 EXPECT_TRUE(OpenDocument("testing/resources/bug_551248.pdf")); |
73 FPDF_PAGE page = LoadPage(0); | 72 FPDF_PAGE page = LoadPage(0); |
74 EXPECT_NE(nullptr, page); | 73 EXPECT_NE(nullptr, page); |
75 DoOpenActions(); | 74 DoOpenActions(); |
76 delegate.AdvanceTime(5000); | 75 delegate.AdvanceTime(5000); |
77 UnloadPage(page); | 76 UnloadPage(page); |
78 | 77 |
79 const auto& alerts = delegate.GetAlerts(); | 78 const auto& alerts = delegate.GetAlerts(); |
80 ASSERT_EQ(1U, alerts.size()); | 79 ASSERT_EQ(1U, alerts.size()); |
81 | 80 |
82 std::wstring message = GetWideString(alerts[0].message); | 81 EXPECT_STREQ(L"hello world", alerts[0].message.c_str()); |
83 std::wstring title = GetWideString(alerts[0].title); | 82 EXPECT_STREQ(L"Alert", alerts[0].title.c_str()); |
84 EXPECT_STREQ(L"hello world", message.c_str()); | |
85 EXPECT_STREQ(L"Alert", title.c_str()); | |
86 EXPECT_EQ(0, alerts[0].type); | 83 EXPECT_EQ(0, alerts[0].type); |
87 EXPECT_EQ(0, alerts[0].icon); | 84 EXPECT_EQ(0, alerts[0].icon); |
88 } | 85 } |
OLD | NEW |