summaryrefslogtreecommitdiffstats
path: root/chrome/test
diff options
context:
space:
mode:
authorthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-05 20:31:41 +0000
committerthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-05 20:31:41 +0000
commit4d9160ff743804acf89a5a50a0b43c113aecc1ab (patch)
treec486f956118f396d6be94569f485632bb313ce21 /chrome/test
parentcf5f25681e397cf802147868f04322f588bd80a2 (diff)
downloadchromium_src-4d9160ff743804acf89a5a50a0b43c113aecc1ab.zip
chromium_src-4d9160ff743804acf89a5a50a0b43c113aecc1ab.tar.gz
chromium_src-4d9160ff743804acf89a5a50a0b43c113aecc1ab.tar.bz2
Add tests for print preview code in PrintWebViewHelper.
BUG=none TEST=included Review URL: http://codereview.chromium.org/6929032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@84302 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test')
-rw-r--r--chrome/test/render_view_test.cc36
-rw-r--r--chrome/test/render_view_test.h7
2 files changed, 0 insertions, 43 deletions
diff --git a/chrome/test/render_view_test.cc b/chrome/test/render_view_test.cc
index 1c8e0c6..55a6dc0 100644
--- a/chrome/test/render_view_test.cc
+++ b/chrome/test/render_view_test.cc
@@ -259,42 +259,6 @@ void RenderViewTest::SendNativeKeyEvent(
view_->OnMessageReceived(*input_message);
}
-void RenderViewTest::VerifyPageCount(int count) {
-#if defined(OS_CHROMEOS)
- // The DidGetPrintedPagesCount message isn't sent on ChromeOS. Right now we
- // always print all pages, and there are checks to that effect built into
- // the print code.
-#else
- const IPC::Message* page_cnt_msg =
- render_thread_.sink().GetUniqueMessageMatching(
- PrintHostMsg_DidGetPrintedPagesCount::ID);
- ASSERT_TRUE(page_cnt_msg);
- PrintHostMsg_DidGetPrintedPagesCount::Param post_page_count_param;
- PrintHostMsg_DidGetPrintedPagesCount::Read(page_cnt_msg,
- &post_page_count_param);
- EXPECT_EQ(count, post_page_count_param.b);
-#endif // defined(OS_CHROMEOS)
-}
-
-void RenderViewTest::VerifyPagesPrinted(bool printed) {
-#if defined(OS_CHROMEOS)
- bool did_print_msg = (NULL != render_thread_.sink().GetUniqueMessageMatching(
- PrintHostMsg_TempFileForPrintingWritten::ID));
- ASSERT_EQ(printed, did_print_msg);
-#else
- const IPC::Message* print_msg =
- render_thread_.sink().GetUniqueMessageMatching(
- PrintHostMsg_DidPrintPage::ID);
- bool did_print_msg = (NULL != print_msg);
- ASSERT_EQ(printed, did_print_msg);
- if (printed) {
- PrintHostMsg_DidPrintPage::Param post_did_print_page_param;
- PrintHostMsg_DidPrintPage::Read(print_msg, &post_did_print_page_param);
- EXPECT_EQ(0, post_did_print_page_param.a.page_number);
- }
-#endif // defined(OS_CHROMEOS)
-}
-
const char* const kGetCoordinatesScript =
"(function() {"
" function GetCoordinates(elem) {"
diff --git a/chrome/test/render_view_test.h b/chrome/test/render_view_test.h
index 5d3ec67..4816f9b 100644
--- a/chrome/test/render_view_test.h
+++ b/chrome/test/render_view_test.h
@@ -75,13 +75,6 @@ class RenderViewTest : public testing::Test {
// Sends one native key event over IPC.
void SendNativeKeyEvent(const NativeWebKeyboardEvent& key_event);
- // The renderer should be done calculating the number of rendered pages
- // according to the specified settings defined in the mock render thread.
- // Verify the page count is correct.
- void VerifyPageCount(int count);
- // Verifies whether the pages printed or not.
- void VerifyPagesPrinted(bool printed);
-
// Returns the bounds (coordinates and size) of the element with id
// |element_id|. Returns an empty rect if such an element was not found.
gfx::Rect GetElementBounds(const std::string& element_id);