Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(140)

Side by Side Diff: content/renderer/disambiguation_popup_helper_unittest.cc

Issue 11740038: Cleanup: Fix some lint errors in content/. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/renderer/disambiguation_popup_helper.cc ('k') | content/renderer/favicon_helper.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/WebKit/chromium/public/platform/WebRect.h"
9 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h" 9 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/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
20 namespace content { 20 namespace content {
21 21
22 class DisambiguationPopupHelperUnittest : public testing::Test { 22 class DisambiguationPopupHelperUnittest : public testing::Test {
23 public: 23 public:
24 DisambiguationPopupHelperUnittest() 24 DisambiguationPopupHelperUnittest()
25 : kViewportSize_(640, 480) { } 25 : kViewportSize_(640, 480) { }
26 protected: 26 protected:
27 const gfx::Size kViewportSize_; 27 const gfx::Size kViewportSize_;
28 }; 28 };
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 tap_rect, target_rects, kViewportSize_, &zoom_rect); 71 tap_rect, target_rects, kViewportSize_, &zoom_rect);
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
OLDNEW
« no previous file with comments | « content/renderer/disambiguation_popup_helper.cc ('k') | content/renderer/favicon_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698