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 "content/renderer/disambiguation_popup_helper.h" | 5 #include "content/renderer/disambiguation_popup_helper.h" |
6 | 6 |
7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
8 #include "third_party/WebKit/public/platform/WebRect.h" | 8 #include "third_party/WebKit/public/platform/WebRect.h" |
9 #include "third_party/WebKit/public/platform/WebVector.h" | 9 #include "third_party/WebKit/public/platform/WebVector.h" |
10 #include "ui/gfx/rect.h" | 10 #include "ui/gfx/geometry/rect.h" |
11 #include "ui/gfx/size.h" | 11 #include "ui/gfx/size.h" |
12 #include "ui/gfx/size_conversions.h" | 12 #include "ui/gfx/size_conversions.h" |
13 | 13 |
14 // these constants are copied from the implementation class | 14 // these constants are copied from the implementation class |
15 namespace { | 15 namespace { |
16 const float kDisambiguationPopupMaxScale = 5.0; | 16 const float kDisambiguationPopupMaxScale = 5.0; |
17 const float kDisambiguationPopupMinScale = 2.0; | 17 const float kDisambiguationPopupMinScale = 2.0; |
18 } // unnamed namespace | 18 } // unnamed namespace |
19 | 19 |
20 namespace content { | 20 namespace content { |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 | 79 |
80 EXPECT_TRUE(gfx::Rect(kVisibleContentSize_).Contains(zoom_rect)); | 80 EXPECT_TRUE(gfx::Rect(kVisibleContentSize_).Contains(zoom_rect)); |
81 EXPECT_EQ(kDisambiguationPopupMaxScale, scale); | 81 EXPECT_EQ(kDisambiguationPopupMaxScale, scale); |
82 EXPECT_TRUE(zoom_rect.Contains(tap_rect)); | 82 EXPECT_TRUE(zoom_rect.Contains(tap_rect)); |
83 | 83 |
84 gfx::Size scaled_size = ToCeiledSize(ScaleSize(zoom_rect.size(), scale)); | 84 gfx::Size scaled_size = ToCeiledSize(ScaleSize(zoom_rect.size(), scale)); |
85 EXPECT_TRUE(gfx::Rect(kScreenSize_).Contains(gfx::Rect(scaled_size))); | 85 EXPECT_TRUE(gfx::Rect(kScreenSize_).Contains(gfx::Rect(scaled_size))); |
86 } | 86 } |
87 | 87 |
88 } // namespace content | 88 } // namespace content |
OLD | NEW |