| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <cstring> | 5 #include <cstring> |
| 6 | 6 |
| 7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "ppapi/c/dev/ppb_printing_dev.h" | 8 #include "ppapi/c/dev/ppb_printing_dev.h" |
| 9 #include "ppapi/c/pp_errors.h" | 9 #include "ppapi/c/pp_errors.h" |
| 10 #include "ppapi/proxy/locking_resource_releaser.h" | 10 #include "ppapi/proxy/locking_resource_releaser.h" |
| 11 #include "ppapi/proxy/plugin_message_filter.h" |
| 11 #include "ppapi/proxy/ppapi_messages.h" | 12 #include "ppapi/proxy/ppapi_messages.h" |
| 12 #include "ppapi/proxy/ppapi_proxy_test.h" | 13 #include "ppapi/proxy/ppapi_proxy_test.h" |
| 13 #include "ppapi/proxy/printing_resource.h" | 14 #include "ppapi/proxy/printing_resource.h" |
| 14 #include "ppapi/thunk/thunk.h" | 15 #include "ppapi/thunk/thunk.h" |
| 15 | 16 |
| 16 namespace ppapi { | 17 namespace ppapi { |
| 17 namespace proxy { | 18 namespace proxy { |
| 18 | 19 |
| 19 namespace { | 20 namespace { |
| 20 | 21 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 PP_PrintSettings_Dev reply_settings = { | 70 PP_PrintSettings_Dev reply_settings = { |
| 70 { { 0, 0 }, { 500, 515 } }, | 71 { { 0, 0 }, { 500, 515 } }, |
| 71 { { 25, 35 }, { 300, 720 } }, | 72 { { 25, 35 }, { 300, 720 } }, |
| 72 { 600, 700 }, | 73 { 600, 700 }, |
| 73 200, | 74 200, |
| 74 PP_PRINTORIENTATION_NORMAL, | 75 PP_PRINTORIENTATION_NORMAL, |
| 75 PP_PRINTSCALINGOPTION_NONE, | 76 PP_PRINTSCALINGOPTION_NONE, |
| 76 PP_FALSE, | 77 PP_FALSE, |
| 77 PP_PRINTOUTPUTFORMAT_PDF | 78 PP_PRINTOUTPUTFORMAT_PDF |
| 78 }; | 79 }; |
| 79 ASSERT_TRUE(plugin_dispatcher()->OnMessageReceived( | 80 PluginMessageFilter::DispatchResourceReplyForTest( |
| 80 PpapiPluginMsg_ResourceReply(reply_params, | 81 reply_params, |
| 81 PpapiPluginMsg_Printing_GetDefaultPrintSettingsReply( | 82 PpapiPluginMsg_Printing_GetDefaultPrintSettingsReply( |
| 82 reply_settings)))); | 83 reply_settings)); |
| 83 | 84 |
| 84 EXPECT_TRUE(PP_RectEqual(reply_settings.printable_area, | 85 EXPECT_TRUE(PP_RectEqual(reply_settings.printable_area, |
| 85 output_settings.printable_area)); | 86 output_settings.printable_area)); |
| 86 EXPECT_TRUE(PP_RectEqual(reply_settings.content_area, | 87 EXPECT_TRUE(PP_RectEqual(reply_settings.content_area, |
| 87 output_settings.content_area)); | 88 output_settings.content_area)); |
| 88 EXPECT_TRUE(PP_SizeEqual(reply_settings.paper_size, | 89 EXPECT_TRUE(PP_SizeEqual(reply_settings.paper_size, |
| 89 output_settings.paper_size)); | 90 output_settings.paper_size)); |
| 90 EXPECT_EQ(reply_settings.dpi, output_settings.dpi); | 91 EXPECT_EQ(reply_settings.dpi, output_settings.dpi); |
| 91 EXPECT_EQ(reply_settings.orientation, output_settings.orientation); | 92 EXPECT_EQ(reply_settings.orientation, output_settings.orientation); |
| 92 EXPECT_EQ(reply_settings.print_scaling_option, | 93 EXPECT_EQ(reply_settings.print_scaling_option, |
| 93 output_settings.print_scaling_option); | 94 output_settings.print_scaling_option); |
| 94 EXPECT_EQ(reply_settings.grayscale, output_settings.grayscale); | 95 EXPECT_EQ(reply_settings.grayscale, output_settings.grayscale); |
| 95 EXPECT_EQ(reply_settings.format, output_settings.format); | 96 EXPECT_EQ(reply_settings.format, output_settings.format); |
| 96 | 97 |
| 97 EXPECT_EQ(g_callback_result, PP_OK); | 98 EXPECT_EQ(g_callback_result, PP_OK); |
| 98 EXPECT_EQ(g_callback_called, true); | 99 EXPECT_EQ(g_callback_called, true); |
| 99 } | 100 } |
| 100 | 101 |
| 101 } // namespace proxy | 102 } // namespace proxy |
| 102 } // namespace ppapi | 103 } // namespace ppapi |
| OLD | NEW |