| OLD | NEW |
| 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 <map> | 5 #include <map> |
| 6 #include <memory> | 6 #include <memory> |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 // Include views_test_base.h first because the definition of None in X.h | 9 // Include views_test_base.h first because the definition of None in X.h |
| 10 // conflicts with the definition of None in gtest-type-util.h | 10 // conflicts with the definition of None in gtest-type-util.h |
| (...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 566 ui::EventTimeForNow()); | 566 ui::EventTimeForNow()); |
| 567 EXPECT_EQ(gfx::ScaleToFlooredPoint(gfx::Point(300, 100), 1.f / scale), | 567 EXPECT_EQ(gfx::ScaleToFlooredPoint(gfx::Point(300, 100), 1.f / scale), |
| 568 client->drag_widget()->GetWindowBoundsInScreen().origin()); | 568 client->drag_widget()->GetWindowBoundsInScreen().origin()); |
| 569 | 569 |
| 570 client->OnMouseReleased(); | 570 client->OnMouseReleased(); |
| 571 } | 571 } |
| 572 | 572 |
| 573 TEST_F(DesktopDragDropClientAuraX11Test, HighDPI200) { | 573 TEST_F(DesktopDragDropClientAuraX11Test, HighDPI200) { |
| 574 aura::TestScreen* screen = | 574 aura::TestScreen* screen = |
| 575 static_cast<aura::TestScreen*>(display::Screen::GetScreen()); | 575 static_cast<aura::TestScreen*>(display::Screen::GetScreen()); |
| 576 screen->SetDeviceScaleFactor(2.0f); | 576 screen->SetDeviceScaleFactorForTest(2.0f); |
| 577 | 577 |
| 578 base::ThreadTaskRunnerHandle::Get()->PostTask( | 578 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 579 FROM_HERE, base::Bind(&HighDPIStep, client())); | 579 FROM_HERE, base::Bind(&HighDPIStep, client())); |
| 580 int result = StartDragAndDrop(); | 580 int result = StartDragAndDrop(); |
| 581 EXPECT_EQ(ui::DragDropTypes::DRAG_NONE, result); | 581 EXPECT_EQ(ui::DragDropTypes::DRAG_NONE, result); |
| 582 } | 582 } |
| 583 | 583 |
| 584 TEST_F(DesktopDragDropClientAuraX11Test, HighDPI150) { | 584 TEST_F(DesktopDragDropClientAuraX11Test, HighDPI150) { |
| 585 aura::TestScreen* screen = | 585 aura::TestScreen* screen = |
| 586 static_cast<aura::TestScreen*>(display::Screen::GetScreen()); | 586 static_cast<aura::TestScreen*>(display::Screen::GetScreen()); |
| 587 screen->SetDeviceScaleFactor(1.5f); | 587 screen->SetDeviceScaleFactorForTest(1.5f); |
| 588 | 588 |
| 589 base::ThreadTaskRunnerHandle::Get()->PostTask( | 589 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 590 FROM_HERE, base::Bind(&HighDPIStep, client())); | 590 FROM_HERE, base::Bind(&HighDPIStep, client())); |
| 591 int result = StartDragAndDrop(); | 591 int result = StartDragAndDrop(); |
| 592 EXPECT_EQ(ui::DragDropTypes::DRAG_NONE, result); | 592 EXPECT_EQ(ui::DragDropTypes::DRAG_NONE, result); |
| 593 } | 593 } |
| 594 | 594 |
| 595 namespace { | 595 namespace { |
| 596 | 596 |
| 597 void TargetDoesNotRespondStep2(TestDragDropClient* client) { | 597 void TargetDoesNotRespondStep2(TestDragDropClient* client) { |
| (...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1002 // the aura::client::DragDropDelegate is properly notified. | 1002 // the aura::client::DragDropDelegate is properly notified. |
| 1003 TEST_F(DesktopDragDropClientAuraX11ChromeSourceTargetTest, CtrlPressed) { | 1003 TEST_F(DesktopDragDropClientAuraX11ChromeSourceTargetTest, CtrlPressed) { |
| 1004 base::ThreadTaskRunnerHandle::Get()->PostTask( | 1004 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 1005 FROM_HERE, | 1005 FROM_HERE, |
| 1006 base::Bind(&ChromeSourceTargetStep2, client(), ui::EF_CONTROL_DOWN)); | 1006 base::Bind(&ChromeSourceTargetStep2, client(), ui::EF_CONTROL_DOWN)); |
| 1007 int result = StartDragAndDrop(); | 1007 int result = StartDragAndDrop(); |
| 1008 EXPECT_EQ(ui::DragDropTypes::DRAG_COPY, result); | 1008 EXPECT_EQ(ui::DragDropTypes::DRAG_COPY, result); |
| 1009 } | 1009 } |
| 1010 | 1010 |
| 1011 } // namespace views | 1011 } // namespace views |
| OLD | NEW |