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

Unified Diff: ash/shelf/shelf_view_unittest.cc

Issue 2870683002: ash: Remove ShelfModel id conversion functions. (Closed)
Patch Set: Address comments. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/shelf/shelf_view.cc ('k') | chrome/browser/ui/ash/app_list/app_list_controller_ash.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shelf/shelf_view_unittest.cc
diff --git a/ash/shelf/shelf_view_unittest.cc b/ash/shelf/shelf_view_unittest.cc
index 1d969cabbe815ceddc3f6a14f92b2d8bfbd2e6a5..8c36cea60df67c3332a161a18fe9ff443ab9f0c2 100644
--- a/ash/shelf/shelf_view_unittest.cc
+++ b/ash/shelf/shelf_view_unittest.cc
@@ -308,14 +308,10 @@ class ShelfViewTest : public AshTestBase {
}
ShelfButton* GetButtonByID(const ShelfID& id) {
- int index = model_->ItemIndexByID(id);
- return test_api_->GetButton(index);
+ return test_api_->GetButton(model_->ItemIndexByID(id));
}
- ShelfItem GetItemByID(const ShelfID& id) {
- ShelfItems::const_iterator items = model_->ItemByID(id);
- return *items;
- }
+ ShelfItem GetItemByID(const ShelfID& id) { return *model_->ItemByID(id); }
void CheckModelIDs(
const std::vector<std::pair<ShelfID, views::View*>>& id_map) {
@@ -634,11 +630,9 @@ class ShelfViewTest : public AshTestBase {
return model_->items()[index].id;
}
- // Returns the center coordinates for a button. Helper function for an event
- // generator.
+ // Returns the center point of a button. Helper function for event generators.
gfx::Point GetButtonCenter(const ShelfID& button_id) {
- return GetButtonCenter(
- test_api_->GetButton(model_->ItemIndexByID(button_id)));
+ return GetButtonCenter(GetButtonByID(button_id));
}
gfx::Point GetButtonCenter(ShelfButton* button) {
« no previous file with comments | « ash/shelf/shelf_view.cc ('k') | chrome/browser/ui/ash/app_list/app_list_controller_ash.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698