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

Side by Side Diff: ui/views/bubble/bubble_frame_view_unittest.cc

Issue 145033006: views: Make View::set_border() take a scoped_ptr<>. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase to ToT Created 6 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 | « ui/views/bubble/bubble_frame_view.cc ('k') | ui/views/bubble/tray_bubble_view.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 "ui/gfx/insets.h" 5 #include "ui/gfx/insets.h"
6 #include "ui/views/bubble/bubble_border.h" 6 #include "ui/views/bubble/bubble_border.h"
7 #include "ui/views/bubble/bubble_frame_view.h" 7 #include "ui/views/bubble/bubble_frame_view.h"
8 #include "ui/views/test/views_test_base.h" 8 #include "ui/views/test/views_test_base.h"
9 #include "ui/views/widget/widget.h" 9 #include "ui/views/widget/widget.h"
10 10
11 namespace views { 11 namespace views {
12 12
13 typedef ViewsTestBase BubbleFrameViewTest; 13 typedef ViewsTestBase BubbleFrameViewTest;
14 14
15 namespace { 15 namespace {
16 16
17 const BubbleBorder::Arrow kArrow = BubbleBorder::TOP_LEFT; 17 const BubbleBorder::Arrow kArrow = BubbleBorder::TOP_LEFT;
18 const SkColor kColor = SK_ColorRED; 18 const SkColor kColor = SK_ColorRED;
19 const int kMargin = 6; 19 const int kMargin = 6;
20 20
21 class TestBubbleFrameView : public BubbleFrameView { 21 class TestBubbleFrameView : public BubbleFrameView {
22 public: 22 public:
23 TestBubbleFrameView() 23 TestBubbleFrameView()
24 : BubbleFrameView(gfx::Insets(kMargin, kMargin, kMargin, kMargin)), 24 : BubbleFrameView(gfx::Insets(kMargin, kMargin, kMargin, kMargin)),
25 available_bounds_(gfx::Rect(0, 0, 1000, 1000)) { 25 available_bounds_(gfx::Rect(0, 0, 1000, 1000)) {
26 SetBubbleBorder(new BubbleBorder(kArrow, BubbleBorder::NO_SHADOW, kColor)); 26 SetBubbleBorder(scoped_ptr<views::BubbleBorder>(
27 new BubbleBorder(kArrow, BubbleBorder::NO_SHADOW, kColor)));
27 } 28 }
28 virtual ~TestBubbleFrameView() {} 29 virtual ~TestBubbleFrameView() {}
29 30
30 // BubbleFrameView overrides: 31 // BubbleFrameView overrides:
31 virtual gfx::Rect GetAvailableScreenBounds(const gfx::Rect& rect) OVERRIDE { 32 virtual gfx::Rect GetAvailableScreenBounds(const gfx::Rect& rect) OVERRIDE {
32 return available_bounds_; 33 return available_bounds_;
33 } 34 }
34 35
35 private: 36 private:
36 gfx::Rect available_bounds_; 37 gfx::Rect available_bounds_;
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 gfx::Rect(900, 900, 50, 50), // |anchor_rect| 343 gfx::Rect(900, 900, 50, 50), // |anchor_rect|
343 gfx::Size(500, 500), // |client_size| 344 gfx::Size(500, 500), // |client_size|
344 true); // |adjust_if_offscreen| 345 true); // |adjust_if_offscreen|
345 EXPECT_EQ(BubbleBorder::RIGHT_CENTER, frame.bubble_border()->arrow()); 346 EXPECT_EQ(BubbleBorder::RIGHT_CENTER, frame.bubble_border()->arrow());
346 EXPECT_EQ(window_bounds.bottom(), 1000); 347 EXPECT_EQ(window_bounds.bottom(), 1000);
347 EXPECT_EQ(window_bounds.y() + 348 EXPECT_EQ(window_bounds.y() +
348 frame.bubble_border()->GetArrowOffset(window_bounds.size()), 925); 349 frame.bubble_border()->GetArrowOffset(window_bounds.size()), 925);
349 } 350 }
350 351
351 } // namespace views 352 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/bubble/bubble_frame_view.cc ('k') | ui/views/bubble/tray_bubble_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698