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

Side by Side Diff: ui/views/mus/platform_window_mus_unittest.cc

Issue 1975533002: Change ui::Event::time_stamp from TimeDelta to TimeTicks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix gesture recognizer tests Created 4 years, 7 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "ui/views/mus/platform_window_mus.h" 5 #include "ui/views/mus/platform_window_mus.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 native_widget_ = 81 native_widget_ =
82 static_cast<NativeWidgetMus*>(widget_->native_widget_private()); 82 static_cast<NativeWidgetMus*>(widget_->native_widget_private());
83 platform_window_ = native_widget_->window_tree_host()->platform_window(); 83 platform_window_ = native_widget_->window_tree_host()->platform_window();
84 ASSERT_TRUE(platform_window_); 84 ASSERT_TRUE(platform_window_);
85 } 85 }
86 86
87 // Returns a mouse pressed event in the middle of the widget. 87 // Returns a mouse pressed event in the middle of the widget.
88 std::unique_ptr<ui::MouseEvent> CreateMouseEvent() { 88 std::unique_ptr<ui::MouseEvent> CreateMouseEvent() {
89 return base::WrapUnique(new ui::MouseEvent( 89 return base::WrapUnique(new ui::MouseEvent(
90 ui::ET_MOUSE_PRESSED, gfx::Point(50, 50), gfx::Point(50, 50), 90 ui::ET_MOUSE_PRESSED, gfx::Point(50, 50), gfx::Point(50, 50),
91 base::TimeDelta(), ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON)); 91 base::TimeTicks(), ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON));
92 } 92 }
93 93
94 // Simulates an input event to the PlatformWindow. 94 // Simulates an input event to the PlatformWindow.
95 void OnWindowInputEvent( 95 void OnWindowInputEvent(
96 const ui::Event& event, 96 const ui::Event& event,
97 std::unique_ptr<base::Callback<void(mus::mojom::EventResult)>>* 97 std::unique_ptr<base::Callback<void(mus::mojom::EventResult)>>*
98 ack_callback) { 98 ack_callback) {
99 platform_window_->OnWindowInputEvent(native_widget_->window(), event, 99 platform_window_->OnWindowInputEvent(native_widget_->window(), event,
100 ack_callback); 100 ack_callback);
101 } 101 }
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 145
146 // The widget was deleted. 146 // The widget was deleted.
147 EXPECT_FALSE(widget_); 147 EXPECT_FALSE(widget_);
148 148
149 // The platform window took ownership of the callback and called it. 149 // The platform window took ownership of the callback and called it.
150 EXPECT_FALSE(ack_callback); 150 EXPECT_FALSE(ack_callback);
151 EXPECT_EQ(1, ack_callback_count()); 151 EXPECT_EQ(1, ack_callback_count());
152 } 152 }
153 153
154 } // namespace views 154 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698