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 "components/printing/renderer/print_web_view_helper.h" | 5 #include "components/printing/renderer/print_web_view_helper.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <tuple> | 10 #include <tuple> |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 // Try again as if user initiated, without resetting the print count. | 327 // Try again as if user initiated, without resetting the print count. |
328 print_render_thread_->printer()->ResetPrinter(); | 328 print_render_thread_->printer()->ResetPrinter(); |
329 LoadHTML(kPrintOnUserAction); | 329 LoadHTML(kPrintOnUserAction); |
330 gfx::Size new_size(200, 100); | 330 gfx::Size new_size(200, 100); |
331 Resize(new_size, gfx::Rect(), false); | 331 Resize(new_size, gfx::Rect(), false); |
332 | 332 |
333 gfx::Rect bounds = GetElementBounds("print"); | 333 gfx::Rect bounds = GetElementBounds("print"); |
334 EXPECT_FALSE(bounds.IsEmpty()); | 334 EXPECT_FALSE(bounds.IsEmpty()); |
335 blink::WebMouseEvent mouse_event; | 335 blink::WebMouseEvent mouse_event; |
336 mouse_event.type = blink::WebInputEvent::MouseDown; | 336 mouse_event.type = blink::WebInputEvent::MouseDown; |
337 mouse_event.button = blink::WebMouseEvent::ButtonLeft; | 337 mouse_event.button = blink::WebMouseEvent::Button::Left; |
338 mouse_event.x = bounds.CenterPoint().x(); | 338 mouse_event.x = bounds.CenterPoint().x(); |
339 mouse_event.y = bounds.CenterPoint().y(); | 339 mouse_event.y = bounds.CenterPoint().y(); |
340 mouse_event.clickCount = 1; | 340 mouse_event.clickCount = 1; |
341 SendWebMouseEvent(mouse_event); | 341 SendWebMouseEvent(mouse_event); |
342 mouse_event.type = blink::WebInputEvent::MouseUp; | 342 mouse_event.type = blink::WebInputEvent::MouseUp; |
343 SendWebMouseEvent(mouse_event); | 343 SendWebMouseEvent(mouse_event); |
344 ProcessPendingMessages(); | 344 ProcessPendingMessages(); |
345 | 345 |
346 VerifyPageCount(1); | 346 VerifyPageCount(1); |
347 VerifyPagesPrinted(true); | 347 VerifyPagesPrinted(true); |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
634 | 634 |
635 TEST_F(MAYBE_PrintWebViewHelperPreviewTest, PrintWithJavaScript) { | 635 TEST_F(MAYBE_PrintWebViewHelperPreviewTest, PrintWithJavaScript) { |
636 LoadHTML(kPrintOnUserAction); | 636 LoadHTML(kPrintOnUserAction); |
637 gfx::Size new_size(200, 100); | 637 gfx::Size new_size(200, 100); |
638 Resize(new_size, gfx::Rect(), false); | 638 Resize(new_size, gfx::Rect(), false); |
639 | 639 |
640 gfx::Rect bounds = GetElementBounds("print"); | 640 gfx::Rect bounds = GetElementBounds("print"); |
641 EXPECT_FALSE(bounds.IsEmpty()); | 641 EXPECT_FALSE(bounds.IsEmpty()); |
642 blink::WebMouseEvent mouse_event; | 642 blink::WebMouseEvent mouse_event; |
643 mouse_event.type = blink::WebInputEvent::MouseDown; | 643 mouse_event.type = blink::WebInputEvent::MouseDown; |
644 mouse_event.button = blink::WebMouseEvent::ButtonLeft; | 644 mouse_event.button = blink::WebMouseEvent::Button::Left; |
645 mouse_event.x = bounds.CenterPoint().x(); | 645 mouse_event.x = bounds.CenterPoint().x(); |
646 mouse_event.y = bounds.CenterPoint().y(); | 646 mouse_event.y = bounds.CenterPoint().y(); |
647 mouse_event.clickCount = 1; | 647 mouse_event.clickCount = 1; |
648 SendWebMouseEvent(mouse_event); | 648 SendWebMouseEvent(mouse_event); |
649 mouse_event.type = blink::WebInputEvent::MouseUp; | 649 mouse_event.type = blink::WebInputEvent::MouseUp; |
650 SendWebMouseEvent(mouse_event); | 650 SendWebMouseEvent(mouse_event); |
651 | 651 |
652 VerifyPreviewRequest(true); | 652 VerifyPreviewRequest(true); |
653 } | 653 } |
654 | 654 |
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1053 | 1053 |
1054 VerifyPrintFailed(true); | 1054 VerifyPrintFailed(true); |
1055 VerifyPagesPrinted(false); | 1055 VerifyPagesPrinted(false); |
1056 } | 1056 } |
1057 #endif // defined(ENABLE_BASIC_PRINTING) | 1057 #endif // defined(ENABLE_BASIC_PRINTING) |
1058 #endif // defined(ENABLE_PRINT_PREVIEW) | 1058 #endif // defined(ENABLE_PRINT_PREVIEW) |
1059 | 1059 |
1060 #endif // !defined(OS_CHROMEOS) | 1060 #endif // !defined(OS_CHROMEOS) |
1061 | 1061 |
1062 } // namespace printing | 1062 } // namespace printing |
OLD | NEW |