summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordanakj <danakj@chromium.org>2015-09-09 14:12:01 -0700
committerCommit bot <commit-bot@chromium.org>2015-09-09 21:12:50 +0000
commit0ea06d18332965fe9598639cb559318a903ce3f0 (patch)
tree7e77e4684810df24dd692016f17de25cd98c015c
parent759762f2fb102b1a38c3d31eabf57d63048640aa (diff)
downloadchromium_src-0ea06d18332965fe9598639cb559318a903ce3f0.zip
chromium_src-0ea06d18332965fe9598639cb559318a903ce3f0.tar.gz
chromium_src-0ea06d18332965fe9598639cb559318a903ce3f0.tar.bz2
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}
-rw-r--r--ui/aura/gestures/gesture_recognizer_unittest.cc26
-rw-r--r--ui/aura/window_targeter_unittest.cc2
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<GestureEventConsumeDelegate> 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());