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_model.h" | 5 #include "ash/shelf/shelf_model.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "ash/ash_switches.h" | 10 #include "ash/ash_switches.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 EXPECT_EQ(1, model_->item_count()); | 84 EXPECT_EQ(1, model_->item_count()); |
85 | 85 |
86 model_->AddObserver(observer_.get()); | 86 model_->AddObserver(observer_.get()); |
87 } | 87 } |
88 | 88 |
89 void TearDown() override { | 89 void TearDown() override { |
90 observer_.reset(); | 90 observer_.reset(); |
91 model_.reset(); | 91 model_.reset(); |
92 } | 92 } |
93 | 93 |
94 scoped_ptr<ShelfModel> model_; | 94 std::unique_ptr<ShelfModel> model_; |
95 scoped_ptr<TestShelfModelObserver> observer_; | 95 std::unique_ptr<TestShelfModelObserver> observer_; |
96 | 96 |
97 private: | 97 private: |
98 DISALLOW_COPY_AND_ASSIGN(ShelfModelTest); | 98 DISALLOW_COPY_AND_ASSIGN(ShelfModelTest); |
99 }; | 99 }; |
100 | 100 |
101 TEST_F(ShelfModelTest, BasicAssertions) { | 101 TEST_F(ShelfModelTest, BasicAssertions) { |
102 // Add an item. | 102 // Add an item. |
103 ShelfItem item; | 103 ShelfItem item; |
104 item.type = TYPE_APP_SHORTCUT; | 104 item.type = TYPE_APP_SHORTCUT; |
105 int index = model_->Add(item); | 105 int index = model_->Add(item); |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 // Now change the type of the second item and make sure that it is moving | 342 // Now change the type of the second item and make sure that it is moving |
343 // behind the shortcuts. | 343 // behind the shortcuts. |
344 item.type = TYPE_PLATFORM_APP; | 344 item.type = TYPE_PLATFORM_APP; |
345 model_->Set(app2_index, item); | 345 model_->Set(app2_index, item); |
346 | 346 |
347 // The item should have moved in front of the app launcher. | 347 // The item should have moved in front of the app launcher. |
348 EXPECT_EQ(TYPE_PLATFORM_APP, model_->items()[4].type); | 348 EXPECT_EQ(TYPE_PLATFORM_APP, model_->items()[4].type); |
349 } | 349 } |
350 | 350 |
351 } // namespace ash | 351 } // namespace ash |
OLD | NEW |