OLD | NEW |
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 Loading... |
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 ¶m); | 427 ¶m); |
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 Loading... |
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) |
OLD | NEW |