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

Unified Diff: ash/shelf/shelf_view_unittest.cc

Issue 2750463009: mash: Fix ShelfItem mojo struct; add enums and traits. (Closed)
Patch Set: Address comment. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/public/interfaces/shelf_struct_traits.h ('k') | ash/shell/window_watcher.h » ('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 f6722e837926c73d1ceac970ee7081031fa39285..68d28cbb3f33d6f0d067fc4fa5a167b0a176670b 100644
--- a/ash/shelf/shelf_view_unittest.cc
+++ b/ash/shelf/shelf_view_unittest.cc
@@ -37,6 +37,7 @@
#include "base/i18n/rtl.h"
#include "base/macros.h"
#include "base/memory/ptr_util.h"
+#include "base/numerics/safe_conversions.h"
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
@@ -256,9 +257,9 @@ class TestShelfDelegateForShelfView : public TestShelfDelegate {
// ShelfDelegate overrides:
ShelfID GetShelfIDForAppID(const std::string& app_id) override {
- ShelfID id = 0;
- EXPECT_TRUE(base::StringToInt(app_id, &id));
- return id;
+ unsigned id = kInvalidShelfID;
+ EXPECT_TRUE(base::StringToUint(app_id, &id));
+ return base::checked_cast<ShelfID>(id);
}
bool HasShelfIDToAppIDMapping(ShelfID id) const override { return true; }
@@ -553,7 +554,7 @@ class ShelfViewTest : public AshTestBase {
int from,
int to,
ShelfView* shelf_view,
- const std::vector<std::pair<int, views::View*>>& expected_id_map) {
+ const std::vector<std::pair<ShelfID, views::View*>>& expected_id_map) {
views::View* dragged_button =
SimulateDrag(ShelfView::MOUSE, from, to, true);
shelf_view->PointerReleasedOnButton(dragged_button, ShelfView::MOUSE,
@@ -599,13 +600,13 @@ class ShelfViewTest : public AshTestBase {
int total_item_count = model_->item_count();
- int last_visible_item_id_in_shelf =
+ ShelfID last_visible_item_id_in_shelf =
GetItemId(test_api_->GetLastVisibleIndex());
- int second_last_visible_item_id_in_shelf =
+ ShelfID second_last_visible_item_id_in_shelf =
GetItemId(test_api_->GetLastVisibleIndex() - 1);
- int first_visible_item_id_in_overflow =
+ ShelfID first_visible_item_id_in_overflow =
GetItemId(test_api_for_overflow.GetFirstVisibleIndex());
- int second_last_visible_item_id_in_overflow =
+ ShelfID second_last_visible_item_id_in_overflow =
GetItemId(test_api_for_overflow.GetLastVisibleIndex() - 1);
int drag_item_index = test_api_for_overflow.GetLastVisibleIndex();
« no previous file with comments | « ash/public/interfaces/shelf_struct_traits.h ('k') | ash/shell/window_watcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698