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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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(int cookie, |
124 PrintMsg_PrintPages_Params* params, | 124 PrintMsg_PrintPages_Params* params, |
125 const std::vector<int>& pages) { | 125 const std::vector<int>& pages) { |
126 EXPECT_EQ(document_cookie_, cookie); | |
127 | |
128 params->Reset(); | 126 params->Reset(); |
129 params->pages = pages; | 127 params->pages = pages; |
130 SetPrintParams(&(params->params)); | 128 SetPrintParams(&(params->params)); |
131 printer_status_ = PRINTER_PRINTING; | 129 printer_status_ = PRINTER_PRINTING; |
132 } | 130 } |
133 | 131 |
134 void MockPrinter::SetPrintedPagesCount(int cookie, int number_pages) { | 132 void MockPrinter::SetPrintedPagesCount(int cookie, int number_pages) { |
135 // Verify the input parameter and update the printer status so that the | 133 // Verify the input parameter and update the printer status so that the |
136 // RenderViewTest class can verify the this function finishes without errors. | 134 // RenderViewTest class can verify the this function finishes without errors. |
137 EXPECT_EQ(document_cookie_, cookie); | 135 EXPECT_EQ(document_cookie_, cookie); |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 params->printable_size = printable_size_; | 257 params->printable_size = printable_size_; |
260 params->margin_left = margin_left_; | 258 params->margin_left = margin_left_; |
261 params->margin_top = margin_top_; | 259 params->margin_top = margin_top_; |
262 params->is_first_request = is_first_request_; | 260 params->is_first_request = is_first_request_; |
263 params->preview_request_id = preview_request_id_; | 261 params->preview_request_id = preview_request_id_; |
264 params->display_header_footer = display_header_footer_; | 262 params->display_header_footer = display_header_footer_; |
265 params->date = date_; | 263 params->date = date_; |
266 params->title = title_; | 264 params->title = title_; |
267 params->url = url_; | 265 params->url = url_; |
268 } | 266 } |
OLD | NEW |