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

Side by Side Diff: ash/drag_drop/drag_drop_controller_unittest.cc

Issue 11110004: Make gfx::Rect class operations consistently mutate the class they are called on. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: cc/ fixes Created 8 years, 2 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
« no previous file with comments | « ash/display/multi_display_manager.cc ('k') | ash/launcher/launcher_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 "ash/drag_drop/drag_drop_controller.h" 5 #include "ash/drag_drop/drag_drop_controller.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/test/ash_test_base.h" 8 #include "ash/test/ash_test_base.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 void AddViewToWidgetAndResize(views::Widget* widget, views::View* view) { 200 void AddViewToWidgetAndResize(views::Widget* widget, views::View* view) {
201 if (!widget->GetContentsView()) { 201 if (!widget->GetContentsView()) {
202 views::View* contents_view = new views::View; 202 views::View* contents_view = new views::View;
203 widget->SetContentsView(contents_view); 203 widget->SetContentsView(contents_view);
204 } 204 }
205 205
206 views::View* contents_view = widget->GetContentsView(); 206 views::View* contents_view = widget->GetContentsView();
207 contents_view->AddChildView(view); 207 contents_view->AddChildView(view);
208 view->SetBounds(contents_view->width(), 0, 100, 100); 208 view->SetBounds(contents_view->width(), 0, 100, 100);
209 gfx::Rect contents_view_bounds = contents_view->bounds(); 209 gfx::Rect contents_view_bounds = contents_view->bounds();
210 contents_view_bounds = contents_view_bounds.Union(view->bounds()); 210 contents_view_bounds.Union(view->bounds());
211 contents_view->SetBoundsRect(contents_view_bounds); 211 contents_view->SetBoundsRect(contents_view_bounds);
212 widget->SetBounds(contents_view_bounds); 212 widget->SetBounds(contents_view_bounds);
213 } 213 }
214 214
215 } // namespace 215 } // namespace
216 216
217 class DragDropControllerTest : public AshTestBase { 217 class DragDropControllerTest : public AshTestBase {
218 public: 218 public:
219 DragDropControllerTest() : AshTestBase() {} 219 DragDropControllerTest() : AshTestBase() {}
220 virtual ~DragDropControllerTest() {} 220 virtual ~DragDropControllerTest() {}
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 EXPECT_EQ(1, drag_view->num_drag_enters_); 667 EXPECT_EQ(1, drag_view->num_drag_enters_);
668 EXPECT_EQ(num_drags - 1 - drag_view->VerticalDragThreshold(), 668 EXPECT_EQ(num_drags - 1 - drag_view->VerticalDragThreshold(),
669 drag_view->num_drag_updates_); 669 drag_view->num_drag_updates_);
670 EXPECT_EQ(0, drag_view->num_drops_); 670 EXPECT_EQ(0, drag_view->num_drops_);
671 EXPECT_EQ(1, drag_view->num_drag_exits_); 671 EXPECT_EQ(1, drag_view->num_drag_exits_);
672 EXPECT_TRUE(drag_view->drag_done_received_); 672 EXPECT_TRUE(drag_view->drag_done_received_);
673 } 673 }
674 674
675 } // namespace test 675 } // namespace test
676 } // namespace aura 676 } // namespace aura
OLDNEW
« no previous file with comments | « ash/display/multi_display_manager.cc ('k') | ash/launcher/launcher_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698