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

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

Issue 2798173002: mash: Remove ChromeLauncherController's |id_to_item_controller_map_|. (Closed)
Patch Set: Address comment; fix browser tests. Created 3 years, 8 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
« no previous file with comments | « ash/common/shelf/shelf_model_observer.h ('k') | ash/common/shelf/shelf_view.h » ('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_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 19 matching lines...) Expand all
30 AddToResult("moved=%d", moved_count_, &result); 30 AddToResult("moved=%d", moved_count_, &result);
31 added_count_ = removed_count_ = changed_count_ = moved_count_ = 0; 31 added_count_ = removed_count_ = changed_count_ = moved_count_ = 0;
32 return result; 32 return result;
33 } 33 }
34 34
35 // ShelfModelObserver overrides: 35 // ShelfModelObserver overrides:
36 void ShelfItemAdded(int) override { added_count_++; } 36 void ShelfItemAdded(int) override { added_count_++; }
37 void ShelfItemRemoved(int, const ShelfItem&) override { removed_count_++; } 37 void ShelfItemRemoved(int, const ShelfItem&) override { removed_count_++; }
38 void ShelfItemChanged(int, const ShelfItem&) override { changed_count_++; } 38 void ShelfItemChanged(int, const ShelfItem&) override { changed_count_++; }
39 void ShelfItemMoved(int, int) override { moved_count_++; } 39 void ShelfItemMoved(int, int) override { moved_count_++; }
40 void OnSetShelfItemDelegate(ShelfID, ShelfItemDelegate*) override {}
41 40
42 private: 41 private:
43 void AddToResult(const std::string& format, int count, std::string* result) { 42 void AddToResult(const std::string& format, int count, std::string* result) {
44 if (!count) 43 if (!count)
45 return; 44 return;
46 if (!result->empty()) 45 if (!result->empty())
47 *result += " "; 46 *result += " ";
48 *result += base::StringPrintf(format.c_str(), count); 47 *result += base::StringPrintf(format.c_str(), count);
49 } 48 }
50 49
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 // Now change the type of the second item and make sure that it is moving 294 // Now change the type of the second item and make sure that it is moving
296 // behind the shortcuts. 295 // behind the shortcuts.
297 item.type = TYPE_APP; 296 item.type = TYPE_APP;
298 model_->Set(app2_index, item); 297 model_->Set(app2_index, item);
299 298
300 // The item should have moved in front of the app launcher. 299 // The item should have moved in front of the app launcher.
301 EXPECT_EQ(TYPE_APP, model_->items()[4].type); 300 EXPECT_EQ(TYPE_APP, model_->items()[4].type);
302 } 301 }
303 302
304 } // namespace ash 303 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/shelf/shelf_model_observer.h ('k') | ash/common/shelf/shelf_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698