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

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

Issue 7831041: Fix print preview workflow to reflect settings of selected printer. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Update per code review Created 9 years, 3 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/print_web_view_helper.cc ('k') | printing/print_settings_initializer_win.cc » ('j') | 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) 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/common/chrome_switches.h" 5 #include "chrome/common/chrome_switches.h"
6 #include "chrome/common/print_messages.h" 6 #include "chrome/common/print_messages.h"
7 #include "chrome/renderer/print_web_view_helper.h" 7 #include "chrome/renderer/print_web_view_helper.h"
8 #include "chrome/test/base/render_view_test.h" 8 #include "chrome/test/base/render_view_test.h"
9 #include "printing/print_job_constants.h" 9 #include "printing/print_job_constants.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 482
483 // Tests that printing from print preview fails and receiving error messages 483 // Tests that printing from print preview fails and receiving error messages
484 // through that channel all works. 484 // through that channel all works.
485 TEST_F(PrintWebViewHelperPreviewTest, OnPrintForPrintPreviewFail) { 485 TEST_F(PrintWebViewHelperPreviewTest, OnPrintForPrintPreviewFail) {
486 LoadHTML(kPrintPreviewHTML); 486 LoadHTML(kPrintPreviewHTML);
487 487
488 // An empty dictionary should fail. 488 // An empty dictionary should fail.
489 DictionaryValue empty_dict; 489 DictionaryValue empty_dict;
490 PrintWebViewHelper::Get(view_)->OnPrintForPrintPreview(empty_dict); 490 PrintWebViewHelper::Get(view_)->OnPrintForPrintPreview(empty_dict);
491 491
492 VerifyPrintFailed(true);
493 VerifyPagesPrinted(false); 492 VerifyPagesPrinted(false);
494 } 493 }
495 494
496 // Tests that when default printer has invalid printer settings, print preview 495 // Tests that when default printer has invalid printer settings, print preview
497 // receives error message. 496 // receives error message.
498 TEST_F(PrintWebViewHelperPreviewTest, 497 TEST_F(PrintWebViewHelperPreviewTest,
499 OnPrintPreviewUsingInvalidPrinterSettings) { 498 OnPrintPreviewUsingInvalidPrinterSettings) {
500 LoadHTML(kPrintPreviewHTML); 499 LoadHTML(kPrintPreviewHTML);
501 500
502 PrintWebViewHelper::Get(view_)->OnInitiatePrintPreview(); 501 PrintWebViewHelper::Get(view_)->OnInitiatePrintPreview();
(...skipping 20 matching lines...) Expand all
523 LoadHTML(kPrintPreviewHTML); 522 LoadHTML(kPrintPreviewHTML);
524 523
525 // Set mock printer to provide invalid settings. 524 // Set mock printer to provide invalid settings.
526 render_thread_.printer()->UseInvalidSettings(); 525 render_thread_.printer()->UseInvalidSettings();
527 526
528 // Fill in some dummy values. 527 // Fill in some dummy values.
529 DictionaryValue dict; 528 DictionaryValue dict;
530 CreatePrintSettingsDictionary(&dict); 529 CreatePrintSettingsDictionary(&dict);
531 PrintWebViewHelper::Get(view_)->OnPrintForPrintPreview(dict); 530 PrintWebViewHelper::Get(view_)->OnPrintForPrintPreview(dict);
532 531
532 VerifyPrintFailed(true);
533 VerifyPagesPrinted(false); 533 VerifyPagesPrinted(false);
534 } 534 }
535 535
536 #endif // !defined(OS_CHROMEOS) 536 #endif // !defined(OS_CHROMEOS)
OLDNEW
« no previous file with comments | « chrome/renderer/print_web_view_helper.cc ('k') | printing/print_settings_initializer_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698