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

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

Issue 560053002: Do not interchange MOUSE_MOVED and MOUSE_DRAGGED events in Widget (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments addressed Created 6 years, 2 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
« no previous file with comments | « no previous file | ui/views/widget/root_view.cc » ('j') | ui/views/widget/widget_unittest.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <map> 5 #include <map>
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/rand_util.h" 8 #include "base/rand_util.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 EXPECT_EQ(v2->location_.x(), -50); 361 EXPECT_EQ(v2->location_.x(), -50);
362 EXPECT_EQ(v2->location_.y(), -60); 362 EXPECT_EQ(v2->location_.y(), -60);
363 // Make sure v1 did not receive the event 363 // Make sure v1 did not receive the event
364 EXPECT_EQ(v1->last_mouse_event_type_, 0); 364 EXPECT_EQ(v1->last_mouse_event_type_, 0);
365 365
366 // Releasted event out of bounds. Should still go to v2 366 // Releasted event out of bounds. Should still go to v2
367 v1->Reset(); 367 v1->Reset();
368 v2->Reset(); 368 v2->Reset();
369 ui::MouseEvent released(ui::ET_MOUSE_RELEASED, gfx::Point(), gfx::Point(), 0, 369 ui::MouseEvent released(ui::ET_MOUSE_RELEASED, gfx::Point(), gfx::Point(), 0,
370 0); 370 0);
371 root->OnMouseDragged(released); 371 root->OnMouseReleased(released);
sadrul 2014/09/26 20:59:12 whoa
372 EXPECT_EQ(v2->last_mouse_event_type_, ui::ET_MOUSE_RELEASED); 372 EXPECT_EQ(v2->last_mouse_event_type_, ui::ET_MOUSE_RELEASED);
373 EXPECT_EQ(v2->location_.x(), -100); 373 EXPECT_EQ(v2->location_.x(), -100);
374 EXPECT_EQ(v2->location_.y(), -100); 374 EXPECT_EQ(v2->location_.y(), -100);
375 // Make sure v1 did not receive the event 375 // Make sure v1 did not receive the event
376 EXPECT_EQ(v1->last_mouse_event_type_, 0); 376 EXPECT_EQ(v1->last_mouse_event_type_, 0);
377 377
378 widget->CloseNow(); 378 widget->CloseNow();
379 } 379 }
380 380
381 // Confirm that a view can be deleted as part of processing a mouse press. 381 // Confirm that a view can be deleted as part of processing a mouse press.
(...skipping 3316 matching lines...) Expand 10 before | Expand all | Expand 10 after
3698 // notification. 3698 // notification.
3699 TestView* test_view_child_2 = new TestView(); 3699 TestView* test_view_child_2 = new TestView();
3700 test_view->AddChildView(test_view_child_2); 3700 test_view->AddChildView(test_view_child_2);
3701 EXPECT_TRUE(test_view_child_2->native_theme_); 3701 EXPECT_TRUE(test_view_child_2->native_theme_);
3702 EXPECT_EQ(widget->GetNativeTheme(), test_view_child_2->native_theme_); 3702 EXPECT_EQ(widget->GetNativeTheme(), test_view_child_2->native_theme_);
3703 3703
3704 widget->CloseNow(); 3704 widget->CloseNow();
3705 } 3705 }
3706 3706
3707 } // namespace views 3707 } // namespace views
OLDNEW
« no previous file with comments | « no previous file | ui/views/widget/root_view.cc » ('j') | ui/views/widget/widget_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698