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

Side by Side Diff: chrome/test/base/interactive_test_utils_common_views.cc

Issue 2286853002: Add temporary debug logging for crbug.com/639350. (Closed)
Patch Set: Add logging for mouse moves and events. Created 4 years, 3 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 // Methods compiled on all toolkit-views platforms (including Mac). 5 // Methods compiled on all toolkit-views platforms (including Mac).
6 6
7 #include "chrome/test/base/interactive_test_utils.h" 7 #include "chrome/test/base/interactive_test_utils.h"
8 8
9 #include "ui/compositor/layer.h" 9 #include "ui/compositor/layer.h"
10 #include "ui/compositor/layer_animator.h" 10 #include "ui/compositor/layer_animator.h"
11 #include "ui/views/view.h" 11 #include "ui/views/view.h"
12 #include "ui/views/widget/widget.h" 12 #include "ui/views/widget/widget.h"
13 13
14 namespace ui_test_utils { 14 namespace ui_test_utils {
15 15
16 void MoveMouseToCenterAndPress(views::View* view, 16 void MoveMouseToCenterAndPress(views::View* view,
17 ui_controls::MouseButton button, 17 ui_controls::MouseButton button,
18 int state, 18 int state,
19 const base::Closure& closure) { 19 const base::Closure& closure) {
20 if (g_crbug_639350_logging)
21 LOG(ERROR) << "crbug.com/639350 MoveMouseToCenterAndPress A";
20 DCHECK(view); 22 DCHECK(view);
21 DCHECK(view->GetWidget()); 23 DCHECK(view->GetWidget());
22 // Complete any in-progress animation before sending the events so that the 24 // Complete any in-progress animation before sending the events so that the
23 // mouse-event targetting happens reliably, and does not flake because of 25 // mouse-event targetting happens reliably, and does not flake because of
24 // unreliable animation state. 26 // unreliable animation state.
25 ui::Layer* layer = view->GetWidget()->GetLayer(); 27 ui::Layer* layer = view->GetWidget()->GetLayer();
26 if (layer) { 28 if (layer) {
29 if (g_crbug_639350_logging)
30 LOG(ERROR) << "crbug.com/639350 MoveMouseToCenterAndPress B";
27 ui::LayerAnimator* animator = layer->GetAnimator(); 31 ui::LayerAnimator* animator = layer->GetAnimator();
28 if (animator && animator->is_animating()) 32 if (animator && animator->is_animating())
29 animator->StopAnimating(); 33 animator->StopAnimating();
34 if (g_crbug_639350_logging)
35 LOG(ERROR) << "crbug.com/639350 MoveMouseToCenterAndPress C";
30 } 36 }
31 37
38 if (g_crbug_639350_logging)
39 LOG(ERROR) << "crbug.com/639350 MoveMouseToCenterAndPress D";
32 gfx::Point view_center(view->width() / 2, view->height() / 2); 40 gfx::Point view_center(view->width() / 2, view->height() / 2);
33 views::View::ConvertPointToScreen(view, &view_center); 41 views::View::ConvertPointToScreen(view, &view_center);
42 if (g_crbug_639350_logging)
43 LOG(ERROR) << "crbug.com/639350 MoveMouseToCenterAndPress E";
34 ui_controls::SendMouseMoveNotifyWhenDone( 44 ui_controls::SendMouseMoveNotifyWhenDone(
35 view_center.x(), 45 view_center.x(),
36 view_center.y(), 46 view_center.y(),
37 base::Bind(&internal::ClickTask, button, state, closure)); 47 base::Bind(&internal::ClickTask, button, state, closure));
48 if (g_crbug_639350_logging)
49 LOG(ERROR) << "crbug.com/639350 MoveMouseToCenterAndPress F";
38 } 50 }
39 51
40 } // namespace ui_test_utils 52 } // namespace ui_test_utils
OLDNEW
« no previous file with comments | « chrome/test/base/interactive_test_utils.cc ('k') | chrome/test/base/interactive_test_utils_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698