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

Side by Side Diff: ui/views/controls/button/custom_button_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: merge master Created 4 years, 6 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 "ui/views/controls/button/custom_button.h" 5 #include "ui/views/controls/button/custom_button.h"
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 EXPECT_FALSE(button()->canceled()); 325 EXPECT_FALSE(button()->canceled());
326 } 326 }
327 327
328 // No touch on desktop Mac. Tracked in http://crbug.com/445520. 328 // No touch on desktop Mac. Tracked in http://crbug.com/445520.
329 #if !defined(OS_MACOSX) || defined(USE_AURA) 329 #if !defined(OS_MACOSX) || defined(USE_AURA)
330 330
331 namespace { 331 namespace {
332 332
333 void PerformGesture(CustomButton* button, ui::EventType event_type) { 333 void PerformGesture(CustomButton* button, ui::EventType event_type) {
334 ui::GestureEventDetails gesture_details(event_type); 334 ui::GestureEventDetails gesture_details(event_type);
335 base::TimeDelta time_stamp = base::TimeDelta::FromMicroseconds(0); 335 ui::GestureEvent gesture_event(0, 0, 0, base::TimeTicks(), gesture_details);
336 ui::GestureEvent gesture_event(0, 0, 0, time_stamp, gesture_details);
337 button->OnGestureEvent(&gesture_event); 336 button->OnGestureEvent(&gesture_event);
338 } 337 }
339 338
340 } // namespace 339 } // namespace
341 340
342 // Tests that gesture events correctly change the button state. 341 // Tests that gesture events correctly change the button state.
343 TEST_F(CustomButtonTest, GestureEventsSetState) { 342 TEST_F(CustomButtonTest, GestureEventsSetState) {
344 aura::test::TestCursorClient cursor_client( 343 aura::test::TestCursorClient cursor_client(
345 widget()->GetNativeView()->GetRootWindow()); 344 widget()->GetNativeView()->GetRootWindow());
346 345
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 ink_drop_delegate->OnAction(InkDropState::ACTION_PENDING); 476 ink_drop_delegate->OnAction(InkDropState::ACTION_PENDING);
478 477
479 button()->ShowContextMenu(gfx::Point(), ui::MENU_SOURCE_MOUSE); 478 button()->ShowContextMenu(gfx::Point(), ui::MENU_SOURCE_MOUSE);
480 479
481 EXPECT_TRUE(ink_drop_delegate->is_hovered()); 480 EXPECT_TRUE(ink_drop_delegate->is_hovered());
482 EXPECT_EQ(InkDropState::ACTION_PENDING, 481 EXPECT_EQ(InkDropState::ACTION_PENDING,
483 ink_drop_delegate->GetTargetInkDropState()); 482 ink_drop_delegate->GetTargetInkDropState());
484 } 483 }
485 484
486 } // namespace views 485 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698