| 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 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "ash/common/shelf/shelf_item_delegate_manager.h" | 9 #include "ash/common/shelf/shelf_item_delegate_manager.h" |
| 10 #include "ash/common/shelf/shelf_model.h" | 10 #include "ash/common/shelf/shelf_model.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 shelf_view_ = test.shelf_view(); | 50 shelf_view_ = test.shelf_view(); |
| 51 shelf_model_ = shelf_view_->model(); | 51 shelf_model_ = shelf_view_->model(); |
| 52 item_delegate_manager_ = | 52 item_delegate_manager_ = |
| 53 Shell::GetInstance()->shelf_item_delegate_manager(); | 53 Shell::GetInstance()->shelf_item_delegate_manager(); |
| 54 | 54 |
| 55 test_.reset(new ash::test::ShelfViewTestAPI(shelf_view_)); | 55 test_.reset(new ash::test::ShelfViewTestAPI(shelf_view_)); |
| 56 } | 56 } |
| 57 | 57 |
| 58 void TearDown() override { test::AshTestBase::TearDown(); } | 58 void TearDown() override { test::AshTestBase::TearDown(); } |
| 59 | 59 |
| 60 Shelf* shelf() { | 60 Shelf* shelf() { return shelf_; } |
| 61 return shelf_; | |
| 62 } | |
| 63 | 61 |
| 64 ShelfView* shelf_view() { | 62 ShelfView* shelf_view() { return shelf_view_; } |
| 65 return shelf_view_; | |
| 66 } | |
| 67 | 63 |
| 68 ShelfModel* shelf_model() { | 64 ShelfModel* shelf_model() { return shelf_model_; } |
| 69 return shelf_model_; | |
| 70 } | |
| 71 | 65 |
| 72 ShelfItemDelegateManager* item_manager() { | 66 ShelfItemDelegateManager* item_manager() { return item_delegate_manager_; } |
| 73 return item_delegate_manager_; | |
| 74 } | |
| 75 | 67 |
| 76 ash::test::ShelfViewTestAPI* test_api() { | 68 ash::test::ShelfViewTestAPI* test_api() { return test_.get(); } |
| 77 return test_.get(); | |
| 78 } | |
| 79 | 69 |
| 80 private: | 70 private: |
| 81 Shelf* shelf_; | 71 Shelf* shelf_; |
| 82 ShelfView* shelf_view_; | 72 ShelfView* shelf_view_; |
| 83 ShelfModel* shelf_model_; | 73 ShelfModel* shelf_model_; |
| 84 ShelfItemDelegateManager* item_delegate_manager_; | 74 ShelfItemDelegateManager* item_delegate_manager_; |
| 85 std::unique_ptr<test::ShelfViewTestAPI> test_; | 75 std::unique_ptr<test::ShelfViewTestAPI> test_; |
| 86 | 76 |
| 87 DISALLOW_COPY_AND_ASSIGN(ShelfTest); | 77 DISALLOW_COPY_AND_ASSIGN(ShelfTest); |
| 88 }; | 78 }; |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 | 144 |
| 155 // Removes the first item in main shelf view. | 145 // Removes the first item in main shelf view. |
| 156 shelf_model()->RemoveItemAt(shelf_model()->ItemIndexByID(first_item_id)); | 146 shelf_model()->RemoveItemAt(shelf_model()->ItemIndexByID(first_item_id)); |
| 157 | 147 |
| 158 // Waits for all transitions to finish and there should be no crash. | 148 // Waits for all transitions to finish and there should be no crash. |
| 159 test_api()->RunMessageLoopUntilAnimationsDone(); | 149 test_api()->RunMessageLoopUntilAnimationsDone(); |
| 160 EXPECT_FALSE(shelf()->IsShowingOverflowBubble()); | 150 EXPECT_FALSE(shelf()->IsShowingOverflowBubble()); |
| 161 } | 151 } |
| 162 | 152 |
| 163 } // namespace ash | 153 } // namespace ash |
| OLD | NEW |