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 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 void RenderViewTest::SendNativeKeyEvent( | 260 void RenderViewTest::SendNativeKeyEvent( |
261 const NativeWebKeyboardEvent& key_event) { | 261 const NativeWebKeyboardEvent& key_event) { |
262 scoped_ptr<IPC::Message> input_message(new ViewMsg_HandleInputEvent(0)); | 262 scoped_ptr<IPC::Message> input_message(new ViewMsg_HandleInputEvent(0)); |
263 input_message->WriteData(reinterpret_cast<const char*>(&key_event), | 263 input_message->WriteData(reinterpret_cast<const char*>(&key_event), |
264 sizeof(WebKit::WebKeyboardEvent)); | 264 sizeof(WebKit::WebKeyboardEvent)); |
265 view_->OnMessageReceived(*input_message); | 265 view_->OnMessageReceived(*input_message); |
266 } | 266 } |
267 | 267 |
268 void RenderViewTest::VerifyPageCount(int count) { | 268 void RenderViewTest::VerifyPageCount(int count) { |
269 #if defined(OS_CHROMEOS) | 269 #if defined(OS_CHROMEOS) |
270 // The DidGetPrintedPagesCount message isn't sent on ChromeOS. Right now we | 270 // The DidGetBasicPrintJobInfo message isn't sent on ChromeOS. Right now we |
271 // always print all pages, and there are checks to that effect built into | 271 // always print all pages, and there are checks to that effect built into |
272 // the print code. | 272 // the print code. |
273 #else | 273 #else |
274 const IPC::Message* page_cnt_msg = | 274 const IPC::Message* page_cnt_msg = |
275 render_thread_.sink().GetUniqueMessageMatching( | 275 render_thread_.sink().GetUniqueMessageMatching( |
276 PrintHostMsg_DidGetPrintedPagesCount::ID); | 276 PrintHostMsg_DidGetBasicPrintJobInfo::ID); |
277 ASSERT_TRUE(page_cnt_msg); | 277 ASSERT_TRUE(page_cnt_msg); |
278 PrintHostMsg_DidGetPrintedPagesCount::Param post_page_count_param; | 278 PrintHostMsg_DidGetBasicPrintJobInfo::Param post_page_count_param; |
279 PrintHostMsg_DidGetPrintedPagesCount::Read(page_cnt_msg, | 279 PrintHostMsg_DidGetBasicPrintJobInfo::Read(page_cnt_msg, |
280 &post_page_count_param); | 280 &post_page_count_param); |
281 EXPECT_EQ(count, post_page_count_param.b); | 281 EXPECT_EQ(count, post_page_count_param.b); |
282 #endif // defined(OS_CHROMEOS) | 282 #endif // defined(OS_CHROMEOS) |
283 } | 283 } |
284 | 284 |
285 void RenderViewTest::VerifyPagesPrinted(bool printed) { | 285 void RenderViewTest::VerifyPagesPrinted(bool printed) { |
286 #if defined(OS_CHROMEOS) | 286 #if defined(OS_CHROMEOS) |
287 bool did_print_msg = (NULL != render_thread_.sink().GetUniqueMessageMatching( | 287 bool did_print_msg = (NULL != render_thread_.sink().GetUniqueMessageMatching( |
288 PrintHostMsg_TempFileForPrintingWritten::ID)); | 288 PrintHostMsg_TempFileForPrintingWritten::ID)); |
289 ASSERT_EQ(printed, did_print_msg); | 289 ASSERT_EQ(printed, did_print_msg); |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 mouse_event.x = bounds.CenterPoint().x(); | 356 mouse_event.x = bounds.CenterPoint().x(); |
357 mouse_event.y = bounds.CenterPoint().y(); | 357 mouse_event.y = bounds.CenterPoint().y(); |
358 mouse_event.clickCount = 1; | 358 mouse_event.clickCount = 1; |
359 ViewMsg_HandleInputEvent input_event(0); | 359 ViewMsg_HandleInputEvent input_event(0); |
360 scoped_ptr<IPC::Message> input_message(new ViewMsg_HandleInputEvent(0)); | 360 scoped_ptr<IPC::Message> input_message(new ViewMsg_HandleInputEvent(0)); |
361 input_message->WriteData(reinterpret_cast<const char*>(&mouse_event), | 361 input_message->WriteData(reinterpret_cast<const char*>(&mouse_event), |
362 sizeof(WebMouseEvent)); | 362 sizeof(WebMouseEvent)); |
363 view_->OnMessageReceived(*input_message); | 363 view_->OnMessageReceived(*input_message); |
364 return true; | 364 return true; |
365 } | 365 } |
OLD | NEW |