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

Unified Diff: ui/views/bubble/bubble_frame_view_unittest.cc

Issue 12096084: Cleanup BubbleFrameView and BubbleBorder construction. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Additional refactoring and cleanup. 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 side-by-side diff with in-line comments
Download patch
Index: ui/views/bubble/bubble_frame_view_unittest.cc
diff --git a/ui/views/bubble/bubble_frame_view_unittest.cc b/ui/views/bubble/bubble_frame_view_unittest.cc
index fc873f30fa7d2e85cee49d128b75d9e73f0e044f..602d79f9de45a60cdcd131538db1cbfceff12aaa 100644
--- a/ui/views/bubble/bubble_frame_view_unittest.cc
+++ b/ui/views/bubble/bubble_frame_view_unittest.cc
@@ -19,8 +19,8 @@ namespace {
const BubbleBorder::ArrowLocation kArrow = BubbleBorder::TOP_LEFT;
const int kBubbleWidth = 200;
const int kBubbleHeight = 200;
-const SkColor kBackgroundColor = SK_ColorRED;
-const int kDefaultMargin = 6;
+const SkColor kColor = SK_ColorRED;
+const int kMargin = 6;
class SizedBubbleDelegateView : public BubbleDelegateView {
public:
@@ -59,13 +59,9 @@ class TestBubbleFrameView : public BubbleFrameView {
};
TestBubbleFrameView::TestBubbleFrameView()
- : BubbleFrameView(gfx::Insets(kDefaultMargin,
- kDefaultMargin,
- kDefaultMargin,
- kDefaultMargin),
- new BubbleBorder(kArrow, BubbleBorder::NO_SHADOW)),
+ : BubbleFrameView(gfx::Insets(kMargin, kMargin, kMargin, kMargin)),
monitor_bounds_(gfx::Rect(0, 0, 1000, 1000)) {
- bubble_border()->set_background_color(kBackgroundColor);
+ SetBubbleBorder(new BubbleBorder(kArrow, BubbleBorder::NO_SHADOW, kColor));
}
TestBubbleFrameView::~TestBubbleFrameView() {}
@@ -79,7 +75,7 @@ gfx::Rect TestBubbleFrameView::GetMonitorBounds(const gfx::Rect& rect) {
TEST_F(BubbleFrameViewTest, GetBoundsForClientView) {
TestBubbleFrameView frame;
EXPECT_EQ(kArrow, frame.bubble_border()->arrow_location());
- EXPECT_EQ(kBackgroundColor, frame.bubble_border()->background_color());
+ EXPECT_EQ(kColor, frame.bubble_border()->background_color());
int margin_x = frame.content_margins().left();
int margin_y = frame.content_margins().top();

Powered by Google App Engine
This is Rietveld 408576698