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

Side by Side Diff: athena/wm/window_manager_unittest.cc

Issue 481843002: athena: Fix window-layout in split-view mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "athena/wm/public/window_manager.h" 5 #include "athena/wm/public/window_manager.h"
6 6
7 #include "athena/test/athena_test_base.h" 7 #include "athena/test/athena_test_base.h"
8 #include "athena/wm/public/window_list_provider.h" 8 #include "athena/wm/public/window_list_provider.h"
9 #include "athena/wm/split_view_controller.h" 9 #include "athena/wm/split_view_controller.h"
10 #include "athena/wm/window_manager_impl.h" 10 #include "athena/wm/window_manager_impl.h"
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 212
213 // Swipe the title of the right window now. It should switch to |third|. 213 // Swipe the title of the right window now. It should switch to |third|.
214 generator.GestureScrollSequence(gfx::Point(x_middle + 20, 10), 214 generator.GestureScrollSequence(gfx::Point(x_middle + 20, 10),
215 gfx::Point(x_middle + 20, 400), 215 gfx::Point(x_middle + 20, 400),
216 base::TimeDelta::FromMilliseconds(20), 216 base::TimeDelta::FromMilliseconds(20),
217 5); 217 5);
218 EXPECT_EQ(second.get(), wm_api.split_view_controller()->left_window()); 218 EXPECT_EQ(second.get(), wm_api.split_view_controller()->left_window());
219 EXPECT_EQ(third.get(), wm_api.split_view_controller()->right_window()); 219 EXPECT_EQ(third.get(), wm_api.split_view_controller()->right_window());
220 } 220 }
221 221
222 TEST_F(WindowManagerTest, NewWindowBounds) {
223 aura::test::TestWindowDelegate delegate;
224 scoped_ptr<aura::Window> first(CreateWindow(&delegate));
225
226 WindowManagerImplTestApi wm_api;
227 wm_api.container()->AddChild(first.get());
228 // The window should have the same size as the container.
229 EXPECT_EQ(wm_api.container()->bounds().size().ToString(),
230 first->bounds().size().ToString());
231 EXPECT_TRUE(first->bounds().origin().IsOrigin());
232
233 // A second window should have the same bounds as the first one.
234 scoped_ptr<aura::Window> second(CreateWindow(&delegate));
235 wm_api.container()->AddChild(second.get());
236 EXPECT_EQ(first->bounds().ToString(), second->bounds().ToString());
237
238 // Get into split view.
239 wm_api.split_view_controller()->ActivateSplitMode(NULL, NULL);
240 const gfx::Rect left_bounds =
241 wm_api.split_view_controller()->left_window()->bounds();
242 EXPECT_NE(wm_api.container()->bounds().size().ToString(),
243 left_bounds.size().ToString());
244
245 scoped_ptr<aura::Window> third(CreateWindow(&delegate));
246 wm_api.container()->AddChild(third.get());
247 EXPECT_NE(wm_api.split_view_controller()->left_window(), third.get());
248 EXPECT_EQ(left_bounds.ToString(), third->bounds().ToString());
249
250 third->Hide();
251 EXPECT_EQ(
252 left_bounds.ToString(),
253 instance->split_view_controller()->left_window()->bounds().ToString());
254 }
255
222 } // namespace athena 256 } // namespace athena
OLDNEW
« athena/wm/window_manager_impl.h ('K') | « athena/wm/window_manager_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698