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/Source/WebKit/chromium/public/platform/WebRect.h" | 8 #include "third_party/WebKit/Source/Platform/chromium/public/WebRect.h" |
9 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h" | 9 #include "third_party/WebKit/Source/Platform/chromium/public/WebVector.h" |
10 #include "ui/gfx/rect.h" | 10 #include "ui/gfx/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 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 | 72 |
73 EXPECT_TRUE(gfx::Rect(kViewportSize_).Contains(zoom_rect)); | 73 EXPECT_TRUE(gfx::Rect(kViewportSize_).Contains(zoom_rect)); |
74 EXPECT_EQ(kDisambiguationPopupMaxScale, scale); | 74 EXPECT_EQ(kDisambiguationPopupMaxScale, scale); |
75 EXPECT_TRUE(zoom_rect.Contains(tap_rect)); | 75 EXPECT_TRUE(zoom_rect.Contains(tap_rect)); |
76 | 76 |
77 gfx::Size scaled_size = ToCeiledSize(ScaleSize(zoom_rect.size(), scale)); | 77 gfx::Size scaled_size = ToCeiledSize(ScaleSize(zoom_rect.size(), scale)); |
78 EXPECT_TRUE(gfx::Rect(kViewportSize_).Contains(gfx::Rect(scaled_size))); | 78 EXPECT_TRUE(gfx::Rect(kViewportSize_).Contains(gfx::Rect(scaled_size))); |
79 } | 79 } |
80 | 80 |
81 } // namespace content | 81 } // namespace content |
OLD | NEW |