| OLD | NEW |
| 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/test/render_view_test.h" | 5 #include "chrome/test/render_view_test.h" |
| 6 | 6 |
| 7 #include "chrome/browser/extensions/extension_function_dispatcher.h" | 7 #include "chrome/browser/extensions/extension_function_dispatcher.h" |
| 8 #include "chrome/common/extensions/extension.h" | 8 #include "chrome/common/extensions/extension.h" |
| 9 #include "chrome/common/gfx_resource_provider.h" | 9 #include "chrome/common/gfx_resource_provider.h" |
| 10 #include "chrome/common/print_messages.h" | 10 #include "chrome/common/print_messages.h" |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 void RenderViewTest::SendNativeKeyEvent( | 265 void RenderViewTest::SendNativeKeyEvent( |
| 266 const NativeWebKeyboardEvent& key_event) { | 266 const NativeWebKeyboardEvent& key_event) { |
| 267 scoped_ptr<IPC::Message> input_message(new ViewMsg_HandleInputEvent(0)); | 267 scoped_ptr<IPC::Message> input_message(new ViewMsg_HandleInputEvent(0)); |
| 268 input_message->WriteData(reinterpret_cast<const char*>(&key_event), | 268 input_message->WriteData(reinterpret_cast<const char*>(&key_event), |
| 269 sizeof(WebKit::WebKeyboardEvent)); | 269 sizeof(WebKit::WebKeyboardEvent)); |
| 270 view_->OnMessageReceived(*input_message); | 270 view_->OnMessageReceived(*input_message); |
| 271 } | 271 } |
| 272 | 272 |
| 273 void RenderViewTest::VerifyPageCount(int count) { | 273 void RenderViewTest::VerifyPageCount(int count) { |
| 274 #if defined(OS_CHROMEOS) | 274 #if defined(OS_CHROMEOS) |
| 275 // The DidGetPrintedPagesCount message isn't sent on ChromeOS. Right now we | 275 // The DidGetBasicPrintJobInfo message isn't sent on ChromeOS. Right now we |
| 276 // always print all pages, and there are checks to that effect built into | 276 // always print all pages, and there are checks to that effect built into |
| 277 // the print code. | 277 // the print code. |
| 278 #else | 278 #else |
| 279 const IPC::Message* page_cnt_msg = | 279 const IPC::Message* page_cnt_msg = |
| 280 render_thread_.sink().GetUniqueMessageMatching( | 280 render_thread_.sink().GetUniqueMessageMatching( |
| 281 PrintHostMsg_DidGetPrintedPagesCount::ID); | 281 PrintHostMsg_DidGetBasicPrintJobInfo::ID); |
| 282 ASSERT_TRUE(page_cnt_msg); | 282 ASSERT_TRUE(page_cnt_msg); |
| 283 PrintHostMsg_DidGetPrintedPagesCount::Param post_page_count_param; | 283 PrintHostMsg_DidGetBasicPrintJobInfo::Param post_page_count_param; |
| 284 PrintHostMsg_DidGetPrintedPagesCount::Read(page_cnt_msg, | 284 PrintHostMsg_DidGetBasicPrintJobInfo::Read(page_cnt_msg, |
| 285 &post_page_count_param); | 285 &post_page_count_param); |
| 286 EXPECT_EQ(count, post_page_count_param.b); | 286 EXPECT_EQ(count, post_page_count_param.b); |
| 287 #endif // defined(OS_CHROMEOS) | 287 #endif // defined(OS_CHROMEOS) |
| 288 } | 288 } |
| 289 | 289 |
| 290 void RenderViewTest::VerifyPagesPrinted(bool printed) { | 290 void RenderViewTest::VerifyPagesPrinted(bool printed) { |
| 291 #if defined(OS_CHROMEOS) | 291 #if defined(OS_CHROMEOS) |
| 292 bool did_print_msg = (NULL != render_thread_.sink().GetUniqueMessageMatching( | 292 bool did_print_msg = (NULL != render_thread_.sink().GetUniqueMessageMatching( |
| 293 PrintHostMsg_TempFileForPrintingWritten::ID)); | 293 PrintHostMsg_TempFileForPrintingWritten::ID)); |
| 294 ASSERT_EQ(printed, did_print_msg); | 294 ASSERT_EQ(printed, did_print_msg); |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 mouse_event.x = bounds.CenterPoint().x(); | 361 mouse_event.x = bounds.CenterPoint().x(); |
| 362 mouse_event.y = bounds.CenterPoint().y(); | 362 mouse_event.y = bounds.CenterPoint().y(); |
| 363 mouse_event.clickCount = 1; | 363 mouse_event.clickCount = 1; |
| 364 ViewMsg_HandleInputEvent input_event(0); | 364 ViewMsg_HandleInputEvent input_event(0); |
| 365 scoped_ptr<IPC::Message> input_message(new ViewMsg_HandleInputEvent(0)); | 365 scoped_ptr<IPC::Message> input_message(new ViewMsg_HandleInputEvent(0)); |
| 366 input_message->WriteData(reinterpret_cast<const char*>(&mouse_event), | 366 input_message->WriteData(reinterpret_cast<const char*>(&mouse_event), |
| 367 sizeof(WebMouseEvent)); | 367 sizeof(WebMouseEvent)); |
| 368 view_->OnMessageReceived(*input_message); | 368 view_->OnMessageReceived(*input_message); |
| 369 return true; | 369 return true; |
| 370 } | 370 } |
| OLD | NEW |