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

Side by Side Diff: ash/launcher/view_model_utils_unittest.cc

Issue 9033007: Rename the aura_shell namespace to ash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 12 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/launcher/view_model_utils.h" 5 #include "ash/launcher/view_model_utils.h"
6 6
7 #include "ash/launcher/view_model.h" 7 #include "ash/launcher/view_model.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 #include "ui/views/view.h" 9 #include "ui/views/view.h"
10 10
11 namespace aura_shell { 11 namespace ash {
12 12
13 // Makes sure SetViewBoundsToIdealBounds updates the view appropriately. 13 // Makes sure SetViewBoundsToIdealBounds updates the view appropriately.
14 TEST(ViewModelUtils, SetViewBoundsToIdealBounds) { 14 TEST(ViewModelUtils, SetViewBoundsToIdealBounds) {
15 views::View v1; 15 views::View v1;
16 ViewModel model; 16 ViewModel model;
17 model.Add(&v1, 0); 17 model.Add(&v1, 0);
18 gfx::Rect v1_bounds(1, 2, 3, 4); 18 gfx::Rect v1_bounds(1, 2, 3, 4);
19 model.set_ideal_bounds(0, v1_bounds); 19 model.set_ideal_bounds(0, v1_bounds);
20 ViewModelUtils::SetViewBoundsToIdealBounds(model); 20 ViewModelUtils::SetViewBoundsToIdealBounds(model);
21 EXPECT_EQ(v1_bounds, v1.bounds()); 21 EXPECT_EQ(v1_bounds, v1.bounds());
(...skipping 14 matching lines...) Expand all
36 EXPECT_EQ(0, ViewModelUtils::DetermineMoveIndex(model, &v1, 4)); 36 EXPECT_EQ(0, ViewModelUtils::DetermineMoveIndex(model, &v1, 4));
37 EXPECT_EQ(1, ViewModelUtils::DetermineMoveIndex(model, &v1, 506)); 37 EXPECT_EQ(1, ViewModelUtils::DetermineMoveIndex(model, &v1, 506));
38 EXPECT_EQ(2, ViewModelUtils::DetermineMoveIndex(model, &v1, 1010)); 38 EXPECT_EQ(2, ViewModelUtils::DetermineMoveIndex(model, &v1, 1010));
39 EXPECT_EQ(2, ViewModelUtils::DetermineMoveIndex(model, &v1, 2000)); 39 EXPECT_EQ(2, ViewModelUtils::DetermineMoveIndex(model, &v1, 2000));
40 40
41 EXPECT_EQ(0, ViewModelUtils::DetermineMoveIndex(model, &v2, -10)); 41 EXPECT_EQ(0, ViewModelUtils::DetermineMoveIndex(model, &v2, -10));
42 EXPECT_EQ(0, ViewModelUtils::DetermineMoveIndex(model, &v2, 4)); 42 EXPECT_EQ(0, ViewModelUtils::DetermineMoveIndex(model, &v2, 4));
43 EXPECT_EQ(2, ViewModelUtils::DetermineMoveIndex(model, &v2, 12)); 43 EXPECT_EQ(2, ViewModelUtils::DetermineMoveIndex(model, &v2, 12));
44 } 44 }
45 45
46 } // namespace aura_shell 46 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698