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

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

Issue 2718563008: mash: Use mojo for ShelfItemDelegate and [app] MenuItem. (Closed)
Patch Set: Address comments. Created 3 years, 9 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/common/shelf/shelf_model.h" 5 #include "ash/common/shelf/shelf_model.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 9
10 #include "ash/common/shelf/shelf_model_observer.h" 10 #include "ash/common/shelf/shelf_model_observer.h"
(...skipping 27 matching lines...) Expand all
38 38
39 // ShelfModelObserver overrides: 39 // ShelfModelObserver overrides:
40 void ShelfItemAdded(int index) override { added_count_++; } 40 void ShelfItemAdded(int index) override { added_count_++; }
41 void ShelfItemRemoved(int index, ShelfID id) override { removed_count_++; } 41 void ShelfItemRemoved(int index, ShelfID id) override { removed_count_++; }
42 void ShelfItemChanged(int index, const ShelfItem& old_item) override { 42 void ShelfItemChanged(int index, const ShelfItem& old_item) override {
43 changed_count_++; 43 changed_count_++;
44 } 44 }
45 void ShelfItemMoved(int start_index, int target_index) override { 45 void ShelfItemMoved(int start_index, int target_index) override {
46 moved_count_++; 46 moved_count_++;
47 } 47 }
48 void OnSetShelfItemDelegate(ShelfID id, 48 void OnSetShelfItemDelegate(
49 ShelfItemDelegate* item_delegate) override {} 49 ShelfID id,
50 mojom::ShelfItemDelegate* item_delegate) override {}
50 51
51 private: 52 private:
52 void AddToResult(const std::string& format, int count, std::string* result) { 53 void AddToResult(const std::string& format, int count, std::string* result) {
53 if (!count) 54 if (!count)
54 return; 55 return;
55 if (!result->empty()) 56 if (!result->empty())
56 *result += " "; 57 *result += " ";
57 *result += base::StringPrintf(format.c_str(), count); 58 *result += base::StringPrintf(format.c_str(), count);
58 } 59 }
59 60
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 // Now change the type of the second item and make sure that it is moving 304 // Now change the type of the second item and make sure that it is moving
304 // behind the shortcuts. 305 // behind the shortcuts.
305 item.type = TYPE_APP; 306 item.type = TYPE_APP;
306 model_->Set(app2_index, item); 307 model_->Set(app2_index, item);
307 308
308 // The item should have moved in front of the app launcher. 309 // The item should have moved in front of the app launcher.
309 EXPECT_EQ(TYPE_APP, model_->items()[4].type); 310 EXPECT_EQ(TYPE_APP, model_->items()[4].type);
310 } 311 }
311 312
312 } // namespace ash 313 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698