From 0ea06d18332965fe9598639cb559318a903ce3f0 Mon Sep 17 00:00:00 2001 From: danakj Date: Wed, 9 Sep 2015 14:12:01 -0700 Subject: aura: Don't implicitly convert Rect to RectF in aura_unittests. TBR=sky BUG=342848 Review URL: https://codereview.chromium.org/1321333005 Cr-Commit-Position: refs/heads/master@{#348006} --- ui/aura/gestures/gesture_recognizer_unittest.cc | 26 +++++++++++-------------- ui/aura/window_targeter_unittest.cc | 2 +- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/ui/aura/gestures/gesture_recognizer_unittest.cc b/ui/aura/gestures/gesture_recognizer_unittest.cc index ff7ffeb..5404dd4 100644 --- a/ui/aura/gestures/gesture_recognizer_unittest.cc +++ b/ui/aura/gestures/gesture_recognizer_unittest.cc @@ -1105,7 +1105,7 @@ TEST_F(GestureRecognizerTest, GestureEventScrollPrediction) { // Check that the bounding box during a scroll event is correct. TEST_F(GestureRecognizerTest, GestureEventScrollBoundingBox) { TimedEvents tes; - for (float radius = 1; radius <= 10; ++radius) { + for (int radius = 1; radius <= 10; ++radius) { ui::GestureConfiguration::GetInstance()->set_default_radius(radius); scoped_ptr delegate( new GestureEventConsumeDelegate()); @@ -1124,10 +1124,8 @@ TEST_F(GestureRecognizerTest, GestureEventScrollBoundingBox) { kTouchId, tes.Now()); DispatchEventUsingWindowDispatcher(&press); - EXPECT_EQ(gfx::RectF(kPositionX - radius, - kPositionY - radius, - radius * 2, - radius * 2), + EXPECT_EQ(gfx::Rect(kPositionX - radius, kPositionY - radius, radius * 2, + radius * 2), delegate->bounding_box()); const int kScrollAmount = 50; @@ -1135,11 +1133,10 @@ TEST_F(GestureRecognizerTest, GestureEventScrollBoundingBox) { 1, 1, kTouchId, 1, kScrollAmount, delegate.get()); EXPECT_EQ(gfx::Point(1, 1).ToString(), delegate->scroll_begin_position().ToString()); - EXPECT_EQ(gfx::RectF(kPositionX + kScrollAmount - radius, - kPositionY + kScrollAmount - radius, - radius * 2, - radius * 2), - delegate->bounding_box()); + EXPECT_EQ( + gfx::Rect(kPositionX + kScrollAmount - radius, + kPositionY + kScrollAmount - radius, radius * 2, radius * 2), + delegate->bounding_box()); // Release the touch. This should end the scroll. delegate->Reset(); @@ -1149,11 +1146,10 @@ TEST_F(GestureRecognizerTest, GestureEventScrollBoundingBox) { kTouchId, press.time_stamp() + base::TimeDelta::FromMilliseconds(50)); DispatchEventUsingWindowDispatcher(&release); - EXPECT_EQ(gfx::RectF(kPositionX + kScrollAmount - radius, - kPositionY + kScrollAmount - radius, - radius * 2, - radius * 2), - delegate->bounding_box()); + EXPECT_EQ( + gfx::Rect(kPositionX + kScrollAmount - radius, + kPositionY + kScrollAmount - radius, radius * 2, radius * 2), + delegate->bounding_box()); } ui::GestureConfiguration::GetInstance()->set_default_radius(0); } diff --git a/ui/aura/window_targeter_unittest.cc b/ui/aura/window_targeter_unittest.cc index 14dea71..36d36ae 100644 --- a/ui/aura/window_targeter_unittest.cc +++ b/ui/aura/window_targeter_unittest.cc @@ -41,7 +41,7 @@ class WindowTargeterTest : public test::AuraTestBase { }; gfx::RectF GetEffectiveVisibleBoundsInRootWindow(Window* window) { - gfx::RectF bounds = gfx::Rect(window->bounds().size()); + gfx::RectF bounds = gfx::RectF(gfx::SizeF(window->bounds().size())); Window* root = window->GetRootWindow(); CHECK(window->layer()); CHECK(root->layer()); -- cgit v1.1