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

Unified Diff: chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc

Issue 2869473002: Fix crash on openning settings when DCHECK is on. (Closed)
Patch Set: up 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
Index: chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc
diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc
index 36d445deb06939ea9700c8b1a8802ffa9efa2701..5e955cead4782678733ada1bc304a5ec5a8a2b0a 100644
--- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc
+++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc
@@ -89,6 +89,9 @@ using content::WebContents;
namespace {
+constexpr char kFooShelfId[] = "mjemblieefldeffoklbbmkhihdblgaaa";
msw 2017/05/05 21:45:04 Could we use something like kDummyAppId? It seems
khmel 2017/05/05 22:45:12 Good point, no need to have special id here.
+constexpr char kBarShelfId[] = "mjemblieefldeffoklbbmkhihdblgaab";
+
// A callback that records the action taken when a shelf item is selected.
void SelectItemCallback(ash::ShelfAction* action_taken,
base::RunLoop* run_loop,
@@ -475,7 +478,8 @@ IN_PROC_BROWSER_TEST_F(LauncherPlatformAppBrowserTest, PinRunning) {
EXPECT_EQ(ash::STATUS_ACTIVE, item1.status);
// Create a shortcut. The app item should be after it.
- ash::ShelfID foo_id = CreateAppShortcutLauncherItem(ash::ShelfID("foo"));
+ ash::ShelfID foo_id =
+ CreateAppShortcutLauncherItem(ash::ShelfID(kFooShelfId));
++item_count;
ASSERT_EQ(item_count, shelf_model()->item_count());
EXPECT_LT(shelf_model()->ItemIndexByID(foo_id),
@@ -489,7 +493,8 @@ IN_PROC_BROWSER_TEST_F(LauncherPlatformAppBrowserTest, PinRunning) {
EXPECT_EQ(ash::STATUS_ACTIVE, item2.status);
// New shortcuts should come after the item.
- ash::ShelfID bar_id = CreateAppShortcutLauncherItem(ash::ShelfID("bar"));
+ ash::ShelfID bar_id =
+ CreateAppShortcutLauncherItem(ash::ShelfID(kBarShelfId));
++item_count;
ASSERT_EQ(item_count, shelf_model()->item_count());
EXPECT_LT(shelf_model()->ItemIndexByID(id),
@@ -518,7 +523,8 @@ IN_PROC_BROWSER_TEST_F(LauncherPlatformAppBrowserTest, UnpinRunning) {
// Create a second shortcut. This will be needed to force the first one to
// move once it gets unpinned.
- ash::ShelfID foo_id = CreateAppShortcutLauncherItem(ash::ShelfID("foo"));
+ ash::ShelfID foo_id =
+ CreateAppShortcutLauncherItem(ash::ShelfID(kFooShelfId));
++item_count;
ASSERT_EQ(item_count, shelf_model()->item_count());
EXPECT_LT(shelf_model()->ItemIndexByID(shortcut_id),

Powered by Google App Engine
This is Rietveld 408576698