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 "chrome/renderer/mock_printer.h" | 5 #include "chrome/renderer/mock_printer.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/shared_memory.h" | 9 #include "base/shared_memory.h" |
10 #include "base/string16.h" | 10 #include "base/string16.h" |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 settings->params.printable_size = printable_size_; | 113 settings->params.printable_size = printable_size_; |
114 settings->params.is_first_request = is_first_request_; | 114 settings->params.is_first_request = is_first_request_; |
115 settings->params.preview_request_id = preview_request_id_; | 115 settings->params.preview_request_id = preview_request_id_; |
116 settings->params.display_header_footer = display_header_footer_; | 116 settings->params.display_header_footer = display_header_footer_; |
117 settings->params.date = date_; | 117 settings->params.date = date_; |
118 settings->params.title = title_; | 118 settings->params.title = title_; |
119 settings->params.url = url_; | 119 settings->params.url = url_; |
120 printer_status_ = PRINTER_PRINTING; | 120 printer_status_ = PRINTER_PRINTING; |
121 } | 121 } |
122 | 122 |
123 void MockPrinter::UpdateSettings(int cookie, | 123 void MockPrinter::UpdateSettings(PrintMsg_PrintPages_Params* params, |
124 PrintMsg_PrintPages_Params* params, | |
125 const std::vector<int>& pages) { | 124 const std::vector<int>& pages) { |
126 EXPECT_EQ(document_cookie_, cookie); | |
127 | |
128 params->Reset(); | 125 params->Reset(); |
129 params->pages = pages; | 126 params->pages = pages; |
130 SetPrintParams(&(params->params)); | 127 SetPrintParams(&(params->params)); |
131 printer_status_ = PRINTER_PRINTING; | 128 printer_status_ = PRINTER_PRINTING; |
132 } | 129 } |
133 | 130 |
134 void MockPrinter::SetPrintedPagesCount(int cookie, int number_pages) { | 131 void MockPrinter::SetPrintedPagesCount(int cookie, int number_pages) { |
135 // Verify the input parameter and update the printer status so that the | 132 // Verify the input parameter and update the printer status so that the |
136 // RenderViewTest class can verify the this function finishes without errors. | 133 // RenderViewTest class can verify the this function finishes without errors. |
137 EXPECT_EQ(document_cookie_, cookie); | 134 EXPECT_EQ(document_cookie_, cookie); |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 params->printable_size = printable_size_; | 256 params->printable_size = printable_size_; |
260 params->margin_left = margin_left_; | 257 params->margin_left = margin_left_; |
261 params->margin_top = margin_top_; | 258 params->margin_top = margin_top_; |
262 params->is_first_request = is_first_request_; | 259 params->is_first_request = is_first_request_; |
263 params->preview_request_id = preview_request_id_; | 260 params->preview_request_id = preview_request_id_; |
264 params->display_header_footer = display_header_footer_; | 261 params->display_header_footer = display_header_footer_; |
265 params->date = date_; | 262 params->date = date_; |
266 params->title = title_; | 263 params->title = title_; |
267 params->url = url_; | 264 params->url = url_; |
268 } | 265 } |
OLD | NEW |