blob: 9e19e3b34d44b8e04b107a2cd3d762fccb0b44d0 [file] [log] [blame]
license.botbf09a502008-08-24 00:55:551// 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.
initial.commit09911bf2008-07-26 23:55:294
[email protected]8ff1d422009-07-07 21:31:395#include "printing/printing_context.h"
initial.commit09911bf2008-07-26 23:55:296
[email protected]8ff1d422009-07-07 21:31:397#include "printing/printing_test.h"
8#include "printing/print_settings.h"
initial.commit09911bf2008-07-26 23:55:299#include "testing/gtest/include/gtest/gtest.h"
initial.commit09911bf2008-07-26 23:55:2910
11// This test is automatically disabled if no printer is available.
12class PrintingContextTest : public PrintingTest<testing::Test> {
13};
14
[email protected]8390e3d2009-06-21 23:22:5715TEST_F(PrintingContextTest, Base) {
initial.commit09911bf2008-07-26 23:55:2916 printing::PrintSettings settings;
17
18 settings.set_device_name(GetDefaultPrinter());
19 // Initialize it.
20 printing::PrintingContext context;
21 EXPECT_EQ(context.InitWithSettings(settings), printing::PrintingContext::OK);
22
initial.commit09911bf2008-07-26 23:55:2923 // The print may lie to use and may not support world transformation.
24 // Verify right now.
25 XFORM random_matrix = { 1, 0.1f, 0, 1.5f, 0, 1 };
26 EXPECT_TRUE(SetWorldTransform(context.context(), &random_matrix));
27 EXPECT_TRUE(ModifyWorldTransform(context.context(), NULL, MWT_IDENTITY));
28}