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

Unified Diff: ash/shelf/shelf_unittest.cc

Issue 2860503002: mash: Replace int ShelfIDs with AppLaunchID strings. (Closed)
Patch Set: Fix struct traits typo. 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_tooltip_manager_unittest.cc ('k') | ash/shelf/shelf_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shelf/shelf_unittest.cc
diff --git a/ash/shelf/shelf_unittest.cc b/ash/shelf/shelf_unittest.cc
index 68f11f9434b400dbe11a1c1b8d2f5ef28f376f73..57ae3a0ca3a113dca59093f46f0b53d11d89c3a4 100644
--- a/ash/shelf/shelf_unittest.cc
+++ b/ash/shelf/shelf_unittest.cc
@@ -11,6 +11,7 @@
#include "ash/shelf/wm_shelf.h"
#include "ash/test/ash_test_base.h"
#include "ash/test/shelf_view_test_api.h"
+#include "base/strings/string_number_conversions.h"
namespace ash {
@@ -47,6 +48,7 @@ TEST_F(ShelfTest, StatusReflection) {
// Add a running app.
ShelfItem item;
+ item.id = ShelfID("foo");
item.type = TYPE_APP;
item.status = STATUS_RUNNING;
int index = shelf_model()->Add(item);
@@ -67,6 +69,7 @@ TEST_F(ShelfTest, CheckHoverAfterMenu) {
// Add a running app.
ShelfItem item;
+ item.id = ShelfID("foo");
item.type = TYPE_APP;
item.status = STATUS_RUNNING;
int index = shelf_model()->Add(item);
@@ -83,26 +86,24 @@ TEST_F(ShelfTest, CheckHoverAfterMenu) {
TEST_F(ShelfTest, ShowOverflowBubble) {
ShelfWidget* shelf_widget = GetPrimaryShelf()->shelf_widget();
- ShelfID first_item_id = shelf_model()->next_id();
// Add app buttons until overflow occurs.
- int items_added = 0;
+ ShelfItem item;
+ item.type = TYPE_APP;
+ item.status = STATUS_RUNNING;
while (!test_api()->IsOverflowButtonVisible()) {
- ShelfItem item;
- item.type = TYPE_APP;
- item.status = STATUS_RUNNING;
+ item.id = ShelfID(base::IntToString(shelf_model()->item_count()));
shelf_model()->Add(item);
-
- ++items_added;
- ASSERT_LT(items_added, 10000);
+ ASSERT_LT(shelf_model()->item_count(), 10000);
}
// Shows overflow bubble.
test_api()->ShowOverflowBubble();
EXPECT_TRUE(shelf_widget->IsShowingOverflowBubble());
- // Removes the first item in main shelf view.
- shelf_model()->RemoveItemAt(shelf_model()->ItemIndexByID(first_item_id));
+ // Remove one of the first items in the main shelf view.
+ ASSERT_GT(shelf_model()->item_count(), 1);
+ shelf_model()->RemoveItemAt(1);
// Waits for all transitions to finish and there should be no crash.
test_api()->RunMessageLoopUntilAnimationsDone();
« no previous file with comments | « ash/shelf/shelf_tooltip_manager_unittest.cc ('k') | ash/shelf/shelf_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698