| 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 settings->params.is_first_request = is_first_request_; | 107 settings->params.is_first_request = is_first_request_; |
| 108 settings->params.preview_request_id = preview_request_id_; | 108 settings->params.preview_request_id = preview_request_id_; |
| 109 settings->params.display_header_footer = display_header_footer_; | 109 settings->params.display_header_footer = display_header_footer_; |
| 110 settings->params.date = date_; | 110 settings->params.date = date_; |
| 111 settings->params.title = title_; | 111 settings->params.title = title_; |
| 112 settings->params.url = url_; | 112 settings->params.url = url_; |
| 113 printer_status_ = PRINTER_PRINTING; | 113 printer_status_ = PRINTER_PRINTING; |
| 114 } | 114 } |
| 115 | 115 |
| 116 void MockPrinter::UpdateSettings(int cookie, | 116 void MockPrinter::UpdateSettings(int cookie, |
| 117 PrintMsg_PrintPages_Params* params) { | 117 PrintMsg_PrintPages_Params* params, |
| 118 const std::vector<int>& pages) { |
| 118 EXPECT_EQ(document_cookie_, cookie); | 119 EXPECT_EQ(document_cookie_, cookie); |
| 119 | 120 |
| 120 params->Reset(); | 121 params->Reset(); |
| 122 params->pages = pages; |
| 121 SetPrintParams(&(params->params)); | 123 SetPrintParams(&(params->params)); |
| 122 printer_status_ = PRINTER_PRINTING; | 124 printer_status_ = PRINTER_PRINTING; |
| 123 } | 125 } |
| 124 | 126 |
| 125 void MockPrinter::SetPrintedPagesCount(int cookie, int number_pages) { | 127 void MockPrinter::SetPrintedPagesCount(int cookie, int number_pages) { |
| 126 // Verify the input parameter and update the printer status so that the | 128 // Verify the input parameter and update the printer status so that the |
| 127 // RenderViewTest class can verify the this function finishes without errors. | 129 // RenderViewTest class can verify the this function finishes without errors. |
| 128 EXPECT_EQ(document_cookie_, cookie); | 130 EXPECT_EQ(document_cookie_, cookie); |
| 129 EXPECT_EQ(PRINTER_PRINTING, printer_status_); | 131 EXPECT_EQ(PRINTER_PRINTING, printer_status_); |
| 130 EXPECT_EQ(0, number_pages_); | 132 EXPECT_EQ(0, number_pages_); |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 params->printable_size = printable_size_; | 252 params->printable_size = printable_size_; |
| 251 params->margin_left = margin_left_; | 253 params->margin_left = margin_left_; |
| 252 params->margin_top = margin_top_; | 254 params->margin_top = margin_top_; |
| 253 params->is_first_request = is_first_request_; | 255 params->is_first_request = is_first_request_; |
| 254 params->preview_request_id = preview_request_id_; | 256 params->preview_request_id = preview_request_id_; |
| 255 params->display_header_footer = display_header_footer_; | 257 params->display_header_footer = display_header_footer_; |
| 256 params->date = date_; | 258 params->date = date_; |
| 257 params->title = title_; | 259 params->title = title_; |
| 258 params->url = url_; | 260 params->url = url_; |
| 259 } | 261 } |
| OLD | NEW |