OLD | NEW |
---|---|
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 Loading... | |
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 Loading... | |
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 |
OLD | NEW |