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

Side by Side Diff: ash/shelf/shelf_model_unittest.cc

Issue 2869473002: Fix crash on openning settings when DCHECK is on. (Closed)
Patch Set: up Created 3 years, 7 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
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/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/shelf/shelf_model_observer.h" 10 #include "ash/shelf/shelf_model_observer.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 ShelfModelTest() {} 62 ShelfModelTest() {}
63 ~ShelfModelTest() override {} 63 ~ShelfModelTest() override {}
64 64
65 void SetUp() override { 65 void SetUp() override {
66 model_.reset(new ShelfModel); 66 model_.reset(new ShelfModel);
67 observer_.reset(new TestShelfModelObserver); 67 observer_.reset(new TestShelfModelObserver);
68 EXPECT_EQ(0, model_->item_count()); 68 EXPECT_EQ(0, model_->item_count());
69 69
70 ShelfItem item; 70 ShelfItem item;
71 item.type = TYPE_APP_LIST; 71 item.type = TYPE_APP_LIST;
72 item.id = ShelfID("AppListId"); 72 item.id = ShelfID(AppListShelfItemDelegate::kAppListId);
msw 2017/05/05 21:45:04 nit: include the header for this (or use something
khmel 2017/05/05 22:45:12 Done.
73 model_->Add(item); 73 model_->Add(item);
74 EXPECT_EQ(1, model_->item_count()); 74 EXPECT_EQ(1, model_->item_count());
75 75
76 model_->AddObserver(observer_.get()); 76 model_->AddObserver(observer_.get());
77 } 77 }
78 78
79 void TearDown() override { 79 void TearDown() override {
80 observer_.reset(); 80 observer_.reset();
81 model_.reset(); 81 model_.reset();
82 } 82 }
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 428
429 // Unpinning the same app id again should have no change. 429 // Unpinning the same app id again should have no change.
430 model_->UnpinAppWithID(app_id); 430 model_->UnpinAppWithID(app_id);
431 EXPECT_FALSE(model_->IsAppPinned(app_id)); 431 EXPECT_FALSE(model_->IsAppPinned(app_id));
432 EXPECT_EQ(2, model_->item_count()); 432 EXPECT_EQ(2, model_->item_count());
433 EXPECT_EQ(TYPE_APP, model_->items()[index].type); 433 EXPECT_EQ(TYPE_APP, model_->items()[index].type);
434 EXPECT_EQ(item.id, model_->items()[index].id); 434 EXPECT_EQ(item.id, model_->items()[index].id);
435 } 435 }
436 436
437 } // namespace ash 437 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698