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