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

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

Issue 2878133002: mash: Serialize ShelfIDs for property conversion and transport. (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
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 a166ded0987f905381ae6f930ee18299df5d61ab..c3b686116767711c1041d02c61f11950de6517b3 100644
--- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc
+++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc
@@ -2166,14 +2166,13 @@ IN_PROC_BROWSER_TEST_F(ShelfAppBrowserTest, MatchingShelfIDandActiveTab) {
EXPECT_EQ(0, browser()->tab_strip_model()->active_index());
EXPECT_EQ(2, model_->item_count());
- ash::WmWindow* window =
- ash::WmWindow::Get(browser()->window()->GetNativeWindow());
+ aura::Window* window = browser()->window()->GetNativeWindow();
int browser_index = GetIndexOfShelfItemType(ash::TYPE_BROWSER_SHORTCUT);
ash::ShelfID browser_id = model_->items()[browser_index].id;
- ash::ShelfID* id = window->aura_window()->GetProperty(ash::kShelfIDKey);
- ASSERT_NE(nullptr, id);
- EXPECT_EQ(browser_id, *id);
+ ash::ShelfID id =
+ ash::ShelfID::Deserialize(window->GetProperty(ash::kShelfIDKey));
+ EXPECT_EQ(browser_id, id);
ash::ShelfID app_id = CreateShortcut("app1");
EXPECT_EQ(3, model_->item_count());
@@ -2182,16 +2181,14 @@ IN_PROC_BROWSER_TEST_F(ShelfAppBrowserTest, MatchingShelfIDandActiveTab) {
WmShelf::ActivateShelfItem(model_->ItemIndexByID(app_id));
EXPECT_EQ(2, browser()->tab_strip_model()->count());
EXPECT_EQ(1, browser()->tab_strip_model()->active_index());
- id = window->aura_window()->GetProperty(ash::kShelfIDKey);
- ASSERT_NE(nullptr, id);
- EXPECT_EQ(app_id, *id);
+ id = ash::ShelfID::Deserialize(window->GetProperty(ash::kShelfIDKey));
+ EXPECT_EQ(app_id, id);
// Activate the tab at index 0 (NTP) and expect a browser ShelfID.
browser()->tab_strip_model()->ActivateTabAt(0, false);
EXPECT_EQ(0, browser()->tab_strip_model()->active_index());
- id = window->aura_window()->GetProperty(ash::kShelfIDKey);
- ASSERT_NE(nullptr, id);
- EXPECT_EQ(browser_id, *id);
+ id = ash::ShelfID::Deserialize(window->GetProperty(ash::kShelfIDKey));
+ EXPECT_EQ(browser_id, id);
}
IN_PROC_BROWSER_TEST_F(ShelfAppBrowserTest, OverflowBubble) {

Powered by Google App Engine
This is Rietveld 408576698