summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/fsdk_baseform_embeddertest.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2016-03-14 13:51:24 -0400
committerDan Sinclair <dsinclair@chromium.org>2016-03-14 13:51:24 -0400
commitf766ad219f66543654520f6a1955836f519e26d1 (patch)
tree2edf8bc93b89503a3669f7add5b6c2a407b8a78c /fpdfsdk/src/fsdk_baseform_embeddertest.cpp
parent54b0abed08048008498471e39b7c72b034474090 (diff)
downloadpdfium-f766ad219f66543654520f6a1955836f519e26d1.tar.xz
Move fpdfsdk/src up to fpdfsdk/.
This CL moves the files in fpdfsdk/src/ up one level to fpdfsdk/ and fixes up the include paths, include guards and build files. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1799773002 .
Diffstat (limited to 'fpdfsdk/src/fsdk_baseform_embeddertest.cpp')
-rw-r--r--fpdfsdk/src/fsdk_baseform_embeddertest.cpp115
1 files changed, 0 insertions, 115 deletions
diff --git a/fpdfsdk/src/fsdk_baseform_embeddertest.cpp b/fpdfsdk/src/fsdk_baseform_embeddertest.cpp
deleted file mode 100644
index 4fd3bb785c..0000000000
--- a/fpdfsdk/src/fsdk_baseform_embeddertest.cpp
+++ /dev/null
@@ -1,115 +0,0 @@
-// Copyright 2016 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "fpdfsdk/include/fsdk_baseform.h"
-#include "fpdfsdk/include/fsdk_define.h"
-#include "fpdfsdk/include/fsdk_mgr.h"
-#include "testing/embedder_test.h"
-#include "testing/embedder_test_mock_delegate.h"
-#include "testing/embedder_test_timer_handling_delegate.h"
-#include "testing/gmock/include/gmock/gmock.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace {
-
-void CheckRect(const CFX_FloatRect& actual, const CFX_FloatRect& expected) {
- EXPECT_EQ(expected.left, actual.left);
- EXPECT_EQ(expected.bottom, actual.bottom);
- EXPECT_EQ(expected.right, actual.right);
- EXPECT_EQ(expected.top, actual.top);
-}
-
-} // namespace
-
-class FSDKBaseFormEmbeddertest : public EmbedderTest {};
-
-TEST_F(FSDKBaseFormEmbeddertest, CBA_AnnotIterator) {
- EXPECT_TRUE(OpenDocument("annotiter.pdf"));
- EXPECT_TRUE(LoadPage(0));
- EXPECT_TRUE(LoadPage(1));
- EXPECT_TRUE(LoadPage(2));
-
- CFX_FloatRect LeftBottom(200, 200, 220, 220);
- CFX_FloatRect RightBottom(400, 201, 420, 221);
- CFX_FloatRect LeftTop(201, 400, 221, 420);
- CFX_FloatRect RightTop(401, 401, 421, 421);
-
- CPDFSDK_Document* pSDKDoc =
- CPDFSDK_Document::FromFPDFFormHandle(form_handle());
- {
- // Page 0 specifies "row order".
- CBA_AnnotIterator iter(pSDKDoc->GetPageView(0), "Widget", "");
- CPDFSDK_Annot* pAnnot = iter.GetFirstAnnot();
- CheckRect(pAnnot->GetRect(), RightTop);
- pAnnot = iter.GetNextAnnot(pAnnot);
- CheckRect(pAnnot->GetRect(), LeftTop);
- pAnnot = iter.GetNextAnnot(pAnnot);
- CheckRect(pAnnot->GetRect(), RightBottom);
- pAnnot = iter.GetNextAnnot(pAnnot);
- CheckRect(pAnnot->GetRect(), LeftBottom);
- pAnnot = iter.GetNextAnnot(pAnnot);
- EXPECT_EQ(iter.GetFirstAnnot(), pAnnot);
-
- pAnnot = iter.GetLastAnnot();
- CheckRect(pAnnot->GetRect(), LeftBottom);
- pAnnot = iter.GetPrevAnnot(pAnnot);
- CheckRect(pAnnot->GetRect(), RightBottom);
- pAnnot = iter.GetPrevAnnot(pAnnot);
- CheckRect(pAnnot->GetRect(), LeftTop);
- pAnnot = iter.GetPrevAnnot(pAnnot);
- CheckRect(pAnnot->GetRect(), RightTop);
- pAnnot = iter.GetPrevAnnot(pAnnot);
- EXPECT_EQ(iter.GetLastAnnot(), pAnnot);
- }
- {
- // Page 1 specifies "column order"
- CBA_AnnotIterator iter(pSDKDoc->GetPageView(1), "Widget", "");
- CPDFSDK_Annot* pAnnot = iter.GetFirstAnnot();
- CheckRect(pAnnot->GetRect(), RightTop);
- pAnnot = iter.GetNextAnnot(pAnnot);
- CheckRect(pAnnot->GetRect(), RightBottom);
- pAnnot = iter.GetNextAnnot(pAnnot);
- CheckRect(pAnnot->GetRect(), LeftTop);
- pAnnot = iter.GetNextAnnot(pAnnot);
- CheckRect(pAnnot->GetRect(), LeftBottom);
- pAnnot = iter.GetNextAnnot(pAnnot);
- EXPECT_EQ(iter.GetFirstAnnot(), pAnnot);
-
- pAnnot = iter.GetLastAnnot();
- CheckRect(pAnnot->GetRect(), LeftBottom);
- pAnnot = iter.GetPrevAnnot(pAnnot);
- CheckRect(pAnnot->GetRect(), LeftTop);
- pAnnot = iter.GetPrevAnnot(pAnnot);
- CheckRect(pAnnot->GetRect(), RightBottom);
- pAnnot = iter.GetPrevAnnot(pAnnot);
- CheckRect(pAnnot->GetRect(), RightTop);
- pAnnot = iter.GetPrevAnnot(pAnnot);
- EXPECT_EQ(iter.GetLastAnnot(), pAnnot);
- }
- {
- // Page 2 specifies "struct order"
- CBA_AnnotIterator iter(pSDKDoc->GetPageView(2), "Widget", "");
- CPDFSDK_Annot* pAnnot = iter.GetFirstAnnot();
- CheckRect(pAnnot->GetRect(), LeftBottom);
- pAnnot = iter.GetNextAnnot(pAnnot);
- CheckRect(pAnnot->GetRect(), RightTop);
- pAnnot = iter.GetNextAnnot(pAnnot);
- CheckRect(pAnnot->GetRect(), LeftTop);
- pAnnot = iter.GetNextAnnot(pAnnot);
- CheckRect(pAnnot->GetRect(), RightBottom);
- pAnnot = iter.GetNextAnnot(pAnnot);
- EXPECT_EQ(iter.GetFirstAnnot(), pAnnot);
-
- pAnnot = iter.GetLastAnnot();
- CheckRect(pAnnot->GetRect(), RightBottom);
- pAnnot = iter.GetPrevAnnot(pAnnot);
- CheckRect(pAnnot->GetRect(), LeftTop);
- pAnnot = iter.GetPrevAnnot(pAnnot);
- CheckRect(pAnnot->GetRect(), RightTop);
- pAnnot = iter.GetPrevAnnot(pAnnot);
- CheckRect(pAnnot->GetRect(), LeftBottom);
- pAnnot = iter.GetPrevAnnot(pAnnot);
- EXPECT_EQ(iter.GetLastAnnot(), pAnnot);
- }
-}