| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium 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 "printing/printing_context_win.h" | 5 #include "printing/printing_context_win.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "printing/backend/printing_info_win.h" | 9 #include "printing/backend/printing_info_win.h" |
| 10 #include "printing/backend/win_helper.h" | 10 #include "printing/backend/win_helper.h" |
| 11 #include "printing/print_settings.h" | 11 #include "printing/print_settings.h" |
| 12 #include "printing/printing_context_system_dialog_win.h" | 12 #include "printing/printing_context_system_dialog_win.h" |
| 13 #include "printing/printing_test.h" | 13 #include "printing/printing_test.h" |
| 14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
| 15 | 15 |
| 16 namespace printing { | 16 namespace printing { |
| 17 | 17 |
| 18 // This test is automatically disabled if no printer is available. | 18 // This test is automatically disabled if no printer is available. |
| 19 class PrintingContextTest : public PrintingTest<testing::Test>, | 19 class PrintingContextTest : public PrintingTest<testing::Test>, |
| 20 public PrintingContext::Delegate { | 20 public PrintingContext::Delegate { |
| 21 public: | 21 public: |
| 22 void PrintSettingsCallback(PrintingContext::Result result) { | 22 void PrintSettingsCallback(PrintingContext::Result result) { |
| 23 result_ = result; | 23 result_ = result; |
| 24 } | 24 } |
| 25 | 25 |
| 26 // PrintingContext::Delegate methods. | 26 // PrintingContext::Delegate methods. |
| 27 virtual gfx::NativeView GetParentView() override { return NULL; } | 27 gfx::NativeView GetParentView() override { return NULL; } |
| 28 virtual std::string GetAppLocale() override { return std::string(); } | 28 std::string GetAppLocale() override { return std::string(); } |
| 29 | 29 |
| 30 protected: | 30 protected: |
| 31 PrintingContext::Result result() const { return result_; } | 31 PrintingContext::Result result() const { return result_; } |
| 32 | 32 |
| 33 private: | 33 private: |
| 34 PrintingContext::Result result_; | 34 PrintingContext::Result result_; |
| 35 }; | 35 }; |
| 36 | 36 |
| 37 class MockPrintingContextWin : public PrintingContextSytemDialogWin { | 37 class MockPrintingContextWin : public PrintingContextSytemDialogWin { |
| 38 public: | 38 public: |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 EXPECT_EQ(PrintingContext::OK, context->InitWithSettings(settings)); | 180 EXPECT_EQ(PrintingContext::OK, context->InitWithSettings(settings)); |
| 181 | 181 |
| 182 // The print may lie to use and may not support world transformation. | 182 // The print may lie to use and may not support world transformation. |
| 183 // Verify right now. | 183 // Verify right now. |
| 184 XFORM random_matrix = { 1, 0.1f, 0, 1.5f, 0, 1 }; | 184 XFORM random_matrix = { 1, 0.1f, 0, 1.5f, 0, 1 }; |
| 185 EXPECT_TRUE(SetWorldTransform(context->context(), &random_matrix)); | 185 EXPECT_TRUE(SetWorldTransform(context->context(), &random_matrix)); |
| 186 EXPECT_TRUE(ModifyWorldTransform(context->context(), NULL, MWT_IDENTITY)); | 186 EXPECT_TRUE(ModifyWorldTransform(context->context(), NULL, MWT_IDENTITY)); |
| 187 } | 187 } |
| 188 | 188 |
| 189 } // namespace printing | 189 } // namespace printing |
| OLD | NEW |