Mandoline: ConnectToApplication and ConnectToService should fail gracefully
[chromium-blink-merge.git] / printing / page_number_unittest.cc
blobece1e0f6f0afe51dbd55fef8796ce771d03c7e5d
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "printing/page_number.h"
6 #include "printing/print_settings.h"
7 #include "testing/gtest/include/gtest/gtest.h"
9 TEST(PageNumberTest, Count) {
10 printing::PrintSettings settings;
11 printing::PageNumber page;
12 EXPECT_EQ(printing::PageNumber::npos(), page);
13 page.Init(settings, 3);
14 EXPECT_EQ(0, page.ToInt());
15 EXPECT_NE(printing::PageNumber::npos(), page);
16 ++page;
17 EXPECT_EQ(1, page.ToInt());
18 EXPECT_NE(printing::PageNumber::npos(), page);
20 printing::PageNumber page_copy(page);
21 EXPECT_EQ(1, page_copy.ToInt());
22 EXPECT_EQ(1, page.ToInt());
23 ++page;
24 EXPECT_EQ(1, page_copy.ToInt());
25 EXPECT_EQ(2, page.ToInt());
26 ++page;
27 EXPECT_EQ(printing::PageNumber::npos(), page);
28 ++page;
29 EXPECT_EQ(printing::PageNumber::npos(), page);