Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(41)

Side by Side Diff: components/printing/test/print_web_view_helper_browsertest.cc

Issue 2569273002: Add constructors to WebInputEvents and setters so we can work at cleaning up these public structs. (Closed)
Patch Set: Rebase Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 627 matching lines...) Expand 10 before | Expand all | Expand 10 after
638 VerifyPreviewRequest(true); 638 VerifyPreviewRequest(true);
639 } 639 }
640 640
641 TEST_F(MAYBE_PrintWebViewHelperPreviewTest, PrintWithJavaScript) { 641 TEST_F(MAYBE_PrintWebViewHelperPreviewTest, PrintWithJavaScript) {
642 LoadHTML(kPrintOnUserAction); 642 LoadHTML(kPrintOnUserAction);
643 gfx::Size new_size(200, 100); 643 gfx::Size new_size(200, 100);
644 Resize(new_size, false); 644 Resize(new_size, false);
645 645
646 gfx::Rect bounds = GetElementBounds("print"); 646 gfx::Rect bounds = GetElementBounds("print");
647 EXPECT_FALSE(bounds.IsEmpty()); 647 EXPECT_FALSE(bounds.IsEmpty());
648 blink::WebMouseEvent mouse_event; 648 blink::WebMouseEvent mouse_event(blink::WebInputEvent::MouseDown,
649 mouse_event.type = blink::WebInputEvent::MouseDown; 649 blink::WebInputEvent::NoModifiers,
650 blink::WebInputEvent::TimeStampForTesting);
650 mouse_event.button = blink::WebMouseEvent::Button::Left; 651 mouse_event.button = blink::WebMouseEvent::Button::Left;
651 mouse_event.x = bounds.CenterPoint().x(); 652 mouse_event.x = bounds.CenterPoint().x();
652 mouse_event.y = bounds.CenterPoint().y(); 653 mouse_event.y = bounds.CenterPoint().y();
653 mouse_event.clickCount = 1; 654 mouse_event.clickCount = 1;
654 SendWebMouseEvent(mouse_event); 655 SendWebMouseEvent(mouse_event);
655 mouse_event.type = blink::WebInputEvent::MouseUp; 656 mouse_event.setType(blink::WebInputEvent::MouseUp);
656 SendWebMouseEvent(mouse_event); 657 SendWebMouseEvent(mouse_event);
657 658
658 VerifyPreviewRequest(true); 659 VerifyPreviewRequest(true);
659 } 660 }
660 661
661 // Tests that print preview work and sending and receiving messages through 662 // Tests that print preview work and sending and receiving messages through
662 // that channel all works. 663 // that channel all works.
663 TEST_F(MAYBE_PrintWebViewHelperPreviewTest, OnPrintPreview) { 664 TEST_F(MAYBE_PrintWebViewHelperPreviewTest, OnPrintPreview) {
664 LoadHTML(kHelloWorldHTML); 665 LoadHTML(kHelloWorldHTML);
665 666
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
1059 1060
1060 VerifyPrintFailed(true); 1061 VerifyPrintFailed(true);
1061 VerifyPagesPrinted(false); 1062 VerifyPagesPrinted(false);
1062 } 1063 }
1063 #endif // BUILDFLAG(ENABLE_BASIC_PRINTING) 1064 #endif // BUILDFLAG(ENABLE_BASIC_PRINTING)
1064 #endif // BUILDFLAG(ENABLE_PRINT_PREVIEW) 1065 #endif // BUILDFLAG(ENABLE_PRINT_PREVIEW)
1065 1066
1066 #endif // !defined(OS_CHROMEOS) 1067 #endif // !defined(OS_CHROMEOS)
1067 1068
1068 } // namespace printing 1069 } // namespace printing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698