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

Side by Side Diff: ash/common/shelf/shelf_window_watcher_unittest.cc

Issue 2518423003: Combine shelf platform and windowed app types. (Closed)
Patch Set: Fix kInvalidShelfID typo. Created 4 years 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/common/shelf/shelf_view.cc ('k') | ash/common/test/test_shelf_delegate.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 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/common/shelf/shelf_window_watcher.h" 5 #include "ash/common/shelf/shelf_window_watcher.h"
6 6
7 #include "ash/common/shelf/shelf_item_types.h" 7 #include "ash/common/shelf/shelf_item_types.h"
8 #include "ash/common/shelf/shelf_model.h" 8 #include "ash/common/shelf/shelf_model.h"
9 #include "ash/common/wm/window_resizer.h" 9 #include "ash/common/wm/window_resizer.h"
10 #include "ash/common/wm/window_state.h" 10 #include "ash/common/wm/window_state.h"
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 WmWindow* window = WmLookup::Get()->GetWindowForWidget(widget.get()); 150 WmWindow* window = WmLookup::Get()->GetWindowForWidget(widget.get());
151 151
152 // Create a ShelfItem for |window|. 152 // Create a ShelfItem for |window|.
153 ShelfID id = CreateShelfItem(window); 153 ShelfID id = CreateShelfItem(window);
154 EXPECT_EQ(2, model_->item_count()); 154 EXPECT_EQ(2, model_->item_count());
155 155
156 int index = model_->ItemIndexByID(id); 156 int index = model_->ItemIndexByID(id);
157 EXPECT_EQ(STATUS_ACTIVE, model_->items()[index].status); 157 EXPECT_EQ(STATUS_ACTIVE, model_->items()[index].status);
158 158
159 // Update the ShelfItemType for |window|. 159 // Update the ShelfItemType for |window|.
160 window->SetIntProperty(WmWindowProperty::SHELF_ITEM_TYPE, TYPE_PLATFORM_APP); 160 window->SetIntProperty(WmWindowProperty::SHELF_ITEM_TYPE, TYPE_APP);
161 // No new item is created after updating a launcher item. 161 // No new item is created after updating a launcher item.
162 EXPECT_EQ(2, model_->item_count()); 162 EXPECT_EQ(2, model_->item_count());
163 // index and id are not changed after updating a launcher item. 163 // index and id are not changed after updating a launcher item.
164 EXPECT_EQ(index, model_->ItemIndexByID(id)); 164 EXPECT_EQ(index, model_->ItemIndexByID(id));
165 EXPECT_EQ(id, model_->items()[index].id); 165 EXPECT_EQ(id, model_->items()[index].id);
166 } 166 }
167 167
168 TEST_F(ShelfWindowWatcherTest, MaximizeAndRestoreWindow) { 168 TEST_F(ShelfWindowWatcherTest, MaximizeAndRestoreWindow) {
169 // ShelfModel only has an APP_LIST item. 169 // ShelfModel only has an APP_LIST item.
170 EXPECT_EQ(1, model_->item_count()); 170 EXPECT_EQ(1, model_->item_count());
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 // Each ShelfItem is removed when the associated window is destroyed. 301 // Each ShelfItem is removed when the associated window is destroyed.
302 panel_widget.CloseNow(); 302 panel_widget.CloseNow();
303 EXPECT_EQ(3, model_->item_count()); 303 EXPECT_EQ(3, model_->item_count());
304 widget2.reset(); 304 widget2.reset();
305 EXPECT_EQ(2, model_->item_count()); 305 EXPECT_EQ(2, model_->item_count());
306 widget1.reset(); 306 widget1.reset();
307 EXPECT_EQ(1, model_->item_count()); 307 EXPECT_EQ(1, model_->item_count());
308 } 308 }
309 309
310 } // namespace ash 310 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/shelf/shelf_view.cc ('k') | ash/common/test/test_shelf_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698