| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/shelf/shelf.h" | 5 #include "ash/shelf/shelf.h" |
| 6 #include "ash/shelf/shelf_button.h" | 6 #include "ash/shelf/shelf_button.h" |
| 7 #include "ash/shelf/shelf_item_delegate_manager.h" | 7 #include "ash/shelf/shelf_item_delegate_manager.h" |
| 8 #include "ash/shelf/shelf_model.h" | 8 #include "ash/shelf/shelf_model.h" |
| 9 #include "ash/shelf/shelf_view.h" | 9 #include "ash/shelf/shelf_view.h" |
| 10 #include "ash/shelf/shelf_widget.h" | 10 #include "ash/shelf/shelf_widget.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 namespace ash { | 30 namespace ash { |
| 31 | 31 |
| 32 class ShelfTest : public ash::test::AshTestBase { | 32 class ShelfTest : public ash::test::AshTestBase { |
| 33 public: | 33 public: |
| 34 ShelfTest() | 34 ShelfTest() |
| 35 : shelf_(NULL), | 35 : shelf_(NULL), |
| 36 shelf_view_(NULL), | 36 shelf_view_(NULL), |
| 37 shelf_model_(NULL), | 37 shelf_model_(NULL), |
| 38 item_delegate_manager_(NULL) {} | 38 item_delegate_manager_(NULL) {} |
| 39 | 39 |
| 40 virtual ~ShelfTest() {} | 40 ~ShelfTest() override {} |
| 41 | 41 |
| 42 virtual void SetUp() { | 42 void SetUp() override { |
| 43 test::AshTestBase::SetUp(); | 43 test::AshTestBase::SetUp(); |
| 44 | 44 |
| 45 shelf_ = Shelf::ForPrimaryDisplay(); | 45 shelf_ = Shelf::ForPrimaryDisplay(); |
| 46 ASSERT_TRUE(shelf_); | 46 ASSERT_TRUE(shelf_); |
| 47 | 47 |
| 48 test::ShelfTestAPI test(shelf_); | 48 test::ShelfTestAPI test(shelf_); |
| 49 shelf_view_ = test.shelf_view(); | 49 shelf_view_ = test.shelf_view(); |
| 50 shelf_model_ = shelf_view_->model(); | 50 shelf_model_ = shelf_view_->model(); |
| 51 item_delegate_manager_ = | 51 item_delegate_manager_ = |
| 52 Shell::GetInstance()->shelf_item_delegate_manager(); | 52 Shell::GetInstance()->shelf_item_delegate_manager(); |
| 53 | 53 |
| 54 test_.reset(new ash::test::ShelfViewTestAPI(shelf_view_)); | 54 test_.reset(new ash::test::ShelfViewTestAPI(shelf_view_)); |
| 55 } | 55 } |
| 56 | 56 |
| 57 virtual void TearDown() override { | 57 void TearDown() override { test::AshTestBase::TearDown(); } |
| 58 test::AshTestBase::TearDown(); | |
| 59 } | |
| 60 | 58 |
| 61 Shelf* shelf() { | 59 Shelf* shelf() { |
| 62 return shelf_; | 60 return shelf_; |
| 63 } | 61 } |
| 64 | 62 |
| 65 ShelfView* shelf_view() { | 63 ShelfView* shelf_view() { |
| 66 return shelf_view_; | 64 return shelf_view_; |
| 67 } | 65 } |
| 68 | 66 |
| 69 ShelfModel* shelf_model() { | 67 ShelfModel* shelf_model() { |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 | 153 |
| 156 // Removes the first item in main shelf view. | 154 // Removes the first item in main shelf view. |
| 157 shelf_model()->RemoveItemAt(shelf_model()->ItemIndexByID(first_item_id)); | 155 shelf_model()->RemoveItemAt(shelf_model()->ItemIndexByID(first_item_id)); |
| 158 | 156 |
| 159 // Waits for all transitions to finish and there should be no crash. | 157 // Waits for all transitions to finish and there should be no crash. |
| 160 test_api()->RunMessageLoopUntilAnimationsDone(); | 158 test_api()->RunMessageLoopUntilAnimationsDone(); |
| 161 EXPECT_FALSE(shelf()->IsShowingOverflowBubble()); | 159 EXPECT_FALSE(shelf()->IsShowingOverflowBubble()); |
| 162 } | 160 } |
| 163 | 161 |
| 164 } // namespace ash | 162 } // namespace ash |
| OLD | NEW |