1 // Copyright 2019 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "pdf/page_orientation.h"
7 #include "testing/gtest/include/gtest/gtest.h"
12 TEST(PageOrientationTest, RotateClockwise) {
13 EXPECT_EQ(RotateClockwise(PageOrientation::kOriginal),
14 PageOrientation::kClockwise90);
15 EXPECT_EQ(RotateClockwise(PageOrientation::kClockwise90),
16 PageOrientation::kClockwise180);
17 EXPECT_EQ(RotateClockwise(PageOrientation::kClockwise180),
18 PageOrientation::kClockwise270);
19 EXPECT_EQ(RotateClockwise(PageOrientation::kClockwise270),
20 PageOrientation::kOriginal);
21 EXPECT_EQ(RotateClockwise(PageOrientation::kLast),
22 PageOrientation::kOriginal);
25 TEST(PageOrientationTest, RotateCounterclockwise) {
26 EXPECT_EQ(RotateCounterclockwise(PageOrientation::kOriginal),
27 PageOrientation::kClockwise270);
28 EXPECT_EQ(RotateCounterclockwise(PageOrientation::kClockwise90),
29 PageOrientation::kOriginal);
30 EXPECT_EQ(RotateCounterclockwise(PageOrientation::kClockwise180),
31 PageOrientation::kClockwise90);
32 EXPECT_EQ(RotateCounterclockwise(PageOrientation::kClockwise270),
33 PageOrientation::kClockwise180);
34 EXPECT_EQ(RotateCounterclockwise(PageOrientation::kLast),
35 PageOrientation::kClockwise180);
39 } // namespace chrome_pdf