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

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

Issue 9699040: PrintPreview: Hide/Show the header footer option based on print frame margins. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: '' Created 8 years, 9 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') | chrome/test/data/webui/print_preview.js » ('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) 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 "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/chrome_render_view_test.h" 8 #include "chrome/test/base/chrome_render_view_test.h"
9 #include "content/public/renderer/render_view.h" 9 #include "content/public/renderer/render_view.h"
10 #include "printing/print_job_constants.h" 10 #include "printing/print_job_constants.h"
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 if (did_get_default_page_layout_msg) { 424 if (did_get_default_page_layout_msg) {
425 PrintHostMsg_DidGetDefaultPageLayout::Param param; 425 PrintHostMsg_DidGetDefaultPageLayout::Param param;
426 PrintHostMsg_DidGetDefaultPageLayout::Read(default_page_layout_msg, 426 PrintHostMsg_DidGetDefaultPageLayout::Read(default_page_layout_msg,
427 &param); 427 &param);
428 EXPECT_EQ(content_width, param.a.content_width); 428 EXPECT_EQ(content_width, param.a.content_width);
429 EXPECT_EQ(content_height, param.a.content_height); 429 EXPECT_EQ(content_height, param.a.content_height);
430 EXPECT_EQ(margin_top, param.a.margin_top); 430 EXPECT_EQ(margin_top, param.a.margin_top);
431 EXPECT_EQ(margin_right, param.a.margin_right); 431 EXPECT_EQ(margin_right, param.a.margin_right);
432 EXPECT_EQ(margin_left, param.a.margin_left); 432 EXPECT_EQ(margin_left, param.a.margin_left);
433 EXPECT_EQ(margin_bottom, param.a.margin_bottom); 433 EXPECT_EQ(margin_bottom, param.a.margin_bottom);
434 EXPECT_EQ(page_has_print_css, param.b); 434 EXPECT_EQ(page_has_print_css, param.c);
435 } 435 }
436 } 436 }
437 437
438 DISALLOW_COPY_AND_ASSIGN(PrintWebViewHelperPreviewTest); 438 DISALLOW_COPY_AND_ASSIGN(PrintWebViewHelperPreviewTest);
439 }; 439 };
440 440
441 // Tests that print preview work and sending and receiving messages through 441 // Tests that print preview work and sending and receiving messages through
442 // that channel all works. 442 // that channel all works.
443 TEST_F(PrintWebViewHelperPreviewTest, OnPrintPreview) { 443 TEST_F(PrintWebViewHelperPreviewTest, OnPrintPreview) {
444 LoadHTML(kHelloWorldHTML); 444 LoadHTML(kHelloWorldHTML);
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
809 // Fill in some dummy values. 809 // Fill in some dummy values.
810 DictionaryValue dict; 810 DictionaryValue dict;
811 CreatePrintSettingsDictionary(&dict); 811 CreatePrintSettingsDictionary(&dict);
812 OnPrintForPrintPreview(dict); 812 OnPrintForPrintPreview(dict);
813 813
814 VerifyPrintFailed(true); 814 VerifyPrintFailed(true);
815 VerifyPagesPrinted(false); 815 VerifyPagesPrinted(false);
816 } 816 }
817 817
818 #endif // !defined(OS_CHROMEOS) 818 #endif // !defined(OS_CHROMEOS)
OLDNEW
« no previous file with comments | « chrome/renderer/print_web_view_helper.cc ('k') | chrome/test/data/webui/print_preview.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698