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

Side by Side Diff: ui/views/view_targeter_unittest.cc

Issue 395223002: Remove some TODOs related to event targeting in views (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « ui/views/view.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/view_targeter.h" 5 #include "ui/views/view_targeter.h"
6 6
7 #include "ui/events/event_targeter.h" 7 #include "ui/events/event_targeter.h"
8 #include "ui/events/event_utils.h" 8 #include "ui/events/event_utils.h"
9 #include "ui/gfx/path.h" 9 #include "ui/gfx/path.h"
10 #include "ui/views/masked_targeter_delegate.h" 10 #include "ui/views/masked_targeter_delegate.h"
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 EXPECT_TRUE(targeter->SubtreeShouldBeExploredForEvent(&v2, event)); 260 EXPECT_TRUE(targeter->SubtreeShouldBeExploredForEvent(&v2, event));
261 v1.ConvertEventToTarget(&v2, &event); 261 v1.ConvertEventToTarget(&v2, &event);
262 EXPECT_FALSE(targeter->SubtreeShouldBeExploredForEvent(&v3, event)); 262 EXPECT_FALSE(targeter->SubtreeShouldBeExploredForEvent(&v3, event));
263 263
264 // Event located outside the bounds of all views. 264 // Event located outside the bounds of all views.
265 event.set_location(gfx::Point(400, 400)); 265 event.set_location(gfx::Point(400, 400));
266 EXPECT_FALSE(targeter->SubtreeShouldBeExploredForEvent(&v1, event)); 266 EXPECT_FALSE(targeter->SubtreeShouldBeExploredForEvent(&v1, event));
267 EXPECT_FALSE(targeter->SubtreeShouldBeExploredForEvent(&v2, event)); 267 EXPECT_FALSE(targeter->SubtreeShouldBeExploredForEvent(&v2, event));
268 v1.ConvertEventToTarget(&v2, &event); 268 v1.ConvertEventToTarget(&v2, &event);
269 EXPECT_FALSE(targeter->SubtreeShouldBeExploredForEvent(&v3, event)); 269 EXPECT_FALSE(targeter->SubtreeShouldBeExploredForEvent(&v3, event));
270
271 // TODO(tdanderson): Move the hit-testing unit tests out of view_unittest
272 // and into here. See crbug.com/355425.
273 } 270 }
274 271
275 // Tests that FindTargetForEvent() returns the correct target when some 272 // Tests that FindTargetForEvent() returns the correct target when some
276 // views in the view tree return false when CanProcessEventsWithinSubtree() 273 // views in the view tree return false when CanProcessEventsWithinSubtree()
277 // is called on them. 274 // is called on them.
278 TEST_F(ViewTargeterTest, CanProcessEventsWithinSubtree) { 275 TEST_F(ViewTargeterTest, CanProcessEventsWithinSubtree) {
279 Widget widget; 276 Widget widget;
280 Widget::InitParams params = CreateParams(Widget::InitParams::TYPE_POPUP); 277 Widget::InitParams params = CreateParams(Widget::InitParams::TYPE_POPUP);
281 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; 278 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
282 params.bounds = gfx::Rect(0, 0, 650, 650); 279 params.bounds = gfx::Rect(0, 0, 650, 650);
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 EXPECT_EQ(v1, root_view->GetTooltipHandlerForPoint(v1_origin)); 471 EXPECT_EQ(v1, root_view->GetTooltipHandlerForPoint(v1_origin));
475 EXPECT_EQ(root_view, root_view->GetTooltipHandlerForPoint(v2_origin)); 472 EXPECT_EQ(root_view, root_view->GetTooltipHandlerForPoint(v2_origin));
476 473
477 EXPECT_FALSE(v1->GetTooltipHandlerForPoint(v2_origin)); 474 EXPECT_FALSE(v1->GetTooltipHandlerForPoint(v2_origin));
478 475
479 widget->CloseNow(); 476 widget->CloseNow();
480 } 477 }
481 478
482 } // namespace test 479 } // namespace test
483 } // namespace views 480 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698