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

Unified Diff: ash/wm/panels/panel_layout_manager_unittest.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
« no previous file with comments | « ash/wm/overview/window_selector_unittest.cc ('k') | ash/wm/panels/panel_window_resizer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/panels/panel_layout_manager_unittest.cc
diff --git a/ash/wm/panels/panel_layout_manager_unittest.cc b/ash/wm/panels/panel_layout_manager_unittest.cc
index 8db7033f15f581706acca07dcf543b3413026487..d0ed13c51c6de8b8b9a71f93a5cb2ad4b63e751a 100644
--- a/ash/wm/panels/panel_layout_manager_unittest.cc
+++ b/ash/wm/panels/panel_layout_manager_unittest.cc
@@ -90,7 +90,8 @@ class PanelLayoutManagerTest : public test::AshTestBase {
aura::Window* window = CreateTestWindowInShellWithDelegateAndType(
delegate, ui::wm::WINDOW_TYPE_PANEL, 0, bounds);
static int id = 0;
- window->SetProperty(kShelfIDKey, new ShelfID(base::IntToString(id++)));
+ std::string shelf_id(ShelfID(base::IntToString(id++)).Serialize());
+ window->SetProperty(kShelfIDKey, new std::string(shelf_id));
shelf_view_test()->RunMessageLoopUntilAnimationsDone();
return window;
}
@@ -219,9 +220,10 @@ class PanelLayoutManagerTest : public test::AshTestBase {
test::ShelfViewTestAPI test_api(shelf_view);
test_api.SetAnimationDuration(1);
test_api.RunMessageLoopUntilAnimationsDone();
- ShelfID* shelf_id = window->GetProperty(kShelfIDKey);
- DCHECK(shelf_id);
- int index = Shell::Get()->shelf_model()->ItemIndexByID(*shelf_id);
+ ShelfID shelf_id = ShelfID::Deserialize(window->GetProperty(kShelfIDKey));
+ DCHECK(!shelf_id.IsNull());
+ int index = Shell::Get()->shelf_model()->ItemIndexByID(shelf_id);
+ DCHECK_GE(index, 0);
gfx::Rect bounds = test_api.GetButton(index)->GetBoundsInScreen();
ui::test::EventGenerator& event_generator = GetEventGenerator();
« no previous file with comments | « ash/wm/overview/window_selector_unittest.cc ('k') | ash/wm/panels/panel_window_resizer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698