Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(403)

Side by Side Diff: chrome/renderer/printing/print_web_view_helper_browsertest.cc

Issue 12177009: Printing selection from context menu. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/renderer/printing/print_web_view_helper.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "chrome/common/chrome_switches.h" 6 #include "chrome/common/chrome_switches.h"
7 #include "chrome/common/print_messages.h" 7 #include "chrome/common/print_messages.h"
8 #include "chrome/renderer/mock_printer.h" 8 #include "chrome/renderer/mock_printer.h"
9 #include "chrome/renderer/printing/print_web_view_helper.h" 9 #include "chrome/renderer/printing/print_web_view_helper.h"
10 #include "chrome/test/base/chrome_render_view_test.h" 10 #include "chrome/test/base/chrome_render_view_test.h"
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 } 164 }
165 #endif // defined(OS_CHROMEOS) 165 #endif // defined(OS_CHROMEOS)
166 } 166 }
167 void OnPrintPages() { 167 void OnPrintPages() {
168 PrintWebViewHelper::Get(view_)->OnPrintPages(); 168 PrintWebViewHelper::Get(view_)->OnPrintPages();
169 ProcessPendingMessages(); 169 ProcessPendingMessages();
170 } 170 }
171 171
172 void OnPrintPreview(const DictionaryValue& dict) { 172 void OnPrintPreview(const DictionaryValue& dict) {
173 PrintWebViewHelper* print_web_view_helper = PrintWebViewHelper::Get(view_); 173 PrintWebViewHelper* print_web_view_helper = PrintWebViewHelper::Get(view_);
174 print_web_view_helper->OnInitiatePrintPreview(); 174 print_web_view_helper->OnInitiatePrintPreview(false);
175 print_web_view_helper->OnPrintPreview(dict); 175 print_web_view_helper->OnPrintPreview(dict);
176 ProcessPendingMessages(); 176 ProcessPendingMessages();
177 } 177 }
178 178
179 void OnPrintForPrintPreview(const DictionaryValue& dict) { 179 void OnPrintForPrintPreview(const DictionaryValue& dict) {
180 PrintWebViewHelper::Get(view_)->OnPrintForPrintPreview(dict); 180 PrintWebViewHelper::Get(view_)->OnPrintForPrintPreview(dict);
181 ProcessPendingMessages(); 181 ProcessPendingMessages();
182 } 182 }
183 183
184 DISALLOW_COPY_AND_ASSIGN(PrintWebViewHelperTestBase); 184 DISALLOW_COPY_AND_ASSIGN(PrintWebViewHelperTestBase);
(...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after
968 chrome_render_thread_->printer()->ResetPrinter(); 968 chrome_render_thread_->printer()->ResetPrinter();
969 VerifyPagesPrinted(false); 969 VerifyPagesPrinted(false);
970 970
971 // Pretend user will print, should not be throttled. 971 // Pretend user will print, should not be throttled.
972 chrome_render_thread_->set_print_dialog_user_response(true); 972 chrome_render_thread_->set_print_dialog_user_response(true);
973 LoadHTML(kPrintWithJSHTML); 973 LoadHTML(kPrintWithJSHTML);
974 VerifyPagesPrinted(true); 974 VerifyPagesPrinted(true);
975 } 975 }
976 976
977 } // namespace printing 977 } // namespace printing
OLDNEW
« no previous file with comments | « chrome/renderer/printing/print_web_view_helper.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698