diff options
author | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-18 02:17:07 +0000 |
---|---|---|
committer | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-18 02:17:07 +0000 |
commit | ac5d13fe66af578325798656c081abf3f8fc83e8 (patch) | |
tree | 1d05f263cba5936edde0cfbeda3ef2c75ef3b2c3 /chrome/test/render_view_test.cc | |
parent | ce21d0fcc67de4f167cad948f767b01bb6862030 (diff) | |
download | chromium_src-ac5d13fe66af578325798656c081abf3f8fc83e8.zip chromium_src-ac5d13fe66af578325798656c081abf3f8fc83e8.tar.gz chromium_src-ac5d13fe66af578325798656c081abf3f8fc83e8.tar.bz2 |
Printing: Simplify window.print() blocking code.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/6665060
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78650 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/render_view_test.cc')
-rw-r--r-- | chrome/test/render_view_test.cc | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/chrome/test/render_view_test.cc b/chrome/test/render_view_test.cc index ca2bd39..3b2d053 100644 --- a/chrome/test/render_view_test.cc +++ b/chrome/test/render_view_test.cc @@ -275,20 +275,22 @@ void RenderViewTest::VerifyPageCount(int count) { #endif // defined(OS_CHROMEOS) } -void RenderViewTest::VerifyPagesPrinted() { +void RenderViewTest::VerifyPagesPrinted(bool printed) { #if defined(OS_CHROMEOS) - const IPC::Message* did_print_msg = - render_thread_.sink().GetUniqueMessageMatching( - ViewHostMsg_TempFileForPrintingWritten::ID); - ASSERT_TRUE(did_print_msg); + bool did_print_msg = (NULL != render_thread_.sink().GetUniqueMessageMatching( + ViewHostMsg_TempFileForPrintingWritten::ID)); + ASSERT_EQ(printed, did_print_msg); #else - const IPC::Message* did_print_msg = + const IPC::Message* print_msg = render_thread_.sink().GetUniqueMessageMatching( ViewHostMsg_DidPrintPage::ID); - ASSERT_TRUE(did_print_msg); - ViewHostMsg_DidPrintPage::Param post_did_print_page_param; - ViewHostMsg_DidPrintPage::Read(did_print_msg, &post_did_print_page_param); - EXPECT_EQ(0, post_did_print_page_param.a.page_number); + bool did_print_msg = (NULL != print_msg); + ASSERT_EQ(printed, did_print_msg); + if (printed) { + ViewHostMsg_DidPrintPage::Param post_did_print_page_param; + ViewHostMsg_DidPrintPage::Read(print_msg, &post_did_print_page_param); + EXPECT_EQ(0, post_did_print_page_param.a.page_number); + } #endif // defined(OS_CHROMEOS) } |