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

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: tot-merge 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
« no previous file with comments | « athena/wm/window_manager_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/screen/public/screen_manager.h" 7 #include "athena/screen/public/screen_manager.h"
8 #include "athena/test/athena_test_base.h" 8 #include "athena/test/athena_test_base.h"
9 #include "athena/wm/public/window_list_provider.h" 9 #include "athena/wm/public/window_list_provider.h"
10 #include "athena/wm/split_view_controller.h" 10 #include "athena/wm/split_view_controller.h"
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 237
238 // Swipe the title of the right window now. It should switch to |third|. 238 // Swipe the title of the right window now. It should switch to |third|.
239 generator.GestureScrollSequence(gfx::Point(x_middle + 20, 10), 239 generator.GestureScrollSequence(gfx::Point(x_middle + 20, 10),
240 gfx::Point(x_middle + 20, 400), 240 gfx::Point(x_middle + 20, 400),
241 base::TimeDelta::FromMilliseconds(20), 241 base::TimeDelta::FromMilliseconds(20),
242 5); 242 5);
243 EXPECT_EQ(second.get(), wm_api.split_view_controller()->left_window()); 243 EXPECT_EQ(second.get(), wm_api.split_view_controller()->left_window());
244 EXPECT_EQ(third.get(), wm_api.split_view_controller()->right_window()); 244 EXPECT_EQ(third.get(), wm_api.split_view_controller()->right_window());
245 } 245 }
246 246
247 TEST_F(WindowManagerTest, NewWindowBounds) {
248 aura::test::TestWindowDelegate delegate;
249 scoped_ptr<aura::Window> first(CreateWindow(&delegate));
250
251 WindowManagerImplTestApi wm_api;
252 aura::client::ParentWindowWithContext(
253 first.get(), ScreenManager::Get()->GetContext(), gfx::Rect());
254 // The window should have the same size as the container.
255 const gfx::Size work_area =
256 gfx::Screen::GetNativeScreen()->GetPrimaryDisplay().work_area().size();
257 EXPECT_EQ(work_area.ToString(),
258 first->bounds().size().ToString());
259 EXPECT_TRUE(first->bounds().origin().IsOrigin());
260
261 // A second window should have the same bounds as the first one.
262 scoped_ptr<aura::Window> second(CreateWindow(&delegate));
263 aura::client::ParentWindowWithContext(
264 second.get(), ScreenManager::Get()->GetContext(), gfx::Rect());
265 EXPECT_EQ(first->bounds().ToString(), second->bounds().ToString());
266
267 // Get into split view.
268 wm_api.split_view_controller()->ActivateSplitMode(NULL, NULL);
269 const gfx::Rect left_bounds =
270 wm_api.split_view_controller()->left_window()->bounds();
271 EXPECT_NE(work_area.ToString(),
272 left_bounds.size().ToString());
273
274 scoped_ptr<aura::Window> third(CreateWindow(&delegate));
275 aura::client::ParentWindowWithContext(
276 third.get(), ScreenManager::Get()->GetContext(), gfx::Rect());
277 EXPECT_NE(wm_api.split_view_controller()->left_window(), third.get());
278 EXPECT_EQ(left_bounds.ToString(), third->bounds().ToString());
279
280 third->Hide();
281 EXPECT_EQ(left_bounds.ToString(),
282 wm_api.split_view_controller()->left_window()->bounds().ToString());
283 }
284
247 } // namespace athena 285 } // namespace athena
OLDNEW
« no previous file with comments | « athena/wm/window_manager_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698