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

Side by Side Diff: content/browser/renderer_host/input/web_input_event_builders_mac_unittest.mm

Issue 2782893002: WebMouseEvent coordinates are now fractional & private (Closed)
Patch Set: Rebased, fixed a comment in web_input_event_builders_mac.mm Created 3 years, 8 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "content/browser/renderer_host/input/web_input_event_builders_mac.h" 5 #include "content/browser/renderer_host/input/web_input_event_builders_mac.h"
6 6
7 #include <Carbon/Carbon.h> 7 #include <Carbon/Carbon.h>
8 #import <Cocoa/Cocoa.h> 8 #import <Cocoa/Cocoa.h>
9 #include <stddef.h> 9 #include <stddef.h>
10 10
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after
602 content::WebMouseWheelEventBuilder::Build(mac_event, 602 content::WebMouseWheelEventBuilder::Build(mac_event,
603 [window contentView]); 603 [window contentView]);
604 ui::MouseWheelEvent ui_event(mac_event); 604 ui::MouseWheelEvent ui_event(mac_event);
605 605
606 EXPECT_EQ(delta_x * ui::kScrollbarPixelsPerCocoaTick, web_event.deltaX); 606 EXPECT_EQ(delta_x * ui::kScrollbarPixelsPerCocoaTick, web_event.deltaX);
607 EXPECT_EQ(web_event.deltaX, ui_event.x_offset()); 607 EXPECT_EQ(web_event.deltaX, ui_event.x_offset());
608 608
609 EXPECT_EQ(delta_y * ui::kScrollbarPixelsPerCocoaTick, web_event.deltaY); 609 EXPECT_EQ(delta_y * ui::kScrollbarPixelsPerCocoaTick, web_event.deltaY);
610 EXPECT_EQ(web_event.deltaY, ui_event.y_offset()); 610 EXPECT_EQ(web_event.deltaY, ui_event.y_offset());
611 611
612 EXPECT_EQ(11, web_event.x); 612 EXPECT_EQ(11, web_event.positionInWidget().x);
613 EXPECT_EQ(web_event.x, ui_event.x()); 613 EXPECT_EQ(web_event.positionInWidget().x, ui_event.x());
614 614
615 // Both ui:: and blink:: events use an origin at the top-left. 615 // Both ui:: and blink:: events use an origin at the top-left.
616 EXPECT_EQ(100 - 22, web_event.y); 616 EXPECT_EQ(100 - 22, web_event.positionInWidget().y);
617 EXPECT_EQ(web_event.y, ui_event.y()); 617 EXPECT_EQ(web_event.positionInWidget().y, ui_event.y());
618 [window close]; 618 [window close];
619 } 619 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698