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

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

Issue 550043002: Keep the split view activities topmost in z-order in Athena (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
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 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 generator.GestureScrollSequence(gfx::Point(20, 10), 253 generator.GestureScrollSequence(gfx::Point(20, 10),
254 gfx::Point(20, 400), 254 gfx::Point(20, 400),
255 base::TimeDelta::FromMilliseconds(20), 255 base::TimeDelta::FromMilliseconds(20),
256 5); 256 5);
257 EXPECT_EQ(second.get(), wm_api.GetSplitViewController()->left_window()); 257 EXPECT_EQ(second.get(), wm_api.GetSplitViewController()->left_window());
258 EXPECT_EQ(fourth.get(), wm_api.GetSplitViewController()->right_window()); 258 EXPECT_EQ(fourth.get(), wm_api.GetSplitViewController()->right_window());
259 aura::Window::Windows windows = 259 aura::Window::Windows windows =
260 wm_api.GetWindowListProvider()->GetWindowList(); 260 wm_api.GetWindowListProvider()->GetWindowList();
261 ASSERT_EQ(4u, windows.size()); 261 ASSERT_EQ(4u, windows.size());
262 EXPECT_EQ(second.get(), windows[3]); 262 EXPECT_EQ(second.get(), windows[3]);
263 EXPECT_EQ(third.get(), windows[2]); 263 EXPECT_EQ(fourth.get(), windows[2]);
264 EXPECT_EQ(fourth.get(), windows[1]);
265 264
266 // Swipe the title of the right window now. It should switch to |third|. 265 // Swipe the title of the right window now. It should switch to |third|.
267 generator.GestureScrollSequence(gfx::Point(x_middle + 20, 10), 266 generator.GestureScrollSequence(gfx::Point(x_middle + 20, 10),
268 gfx::Point(x_middle + 20, 400), 267 gfx::Point(x_middle + 20, 400),
269 base::TimeDelta::FromMilliseconds(20), 268 base::TimeDelta::FromMilliseconds(20),
270 5); 269 5);
271 EXPECT_EQ(second.get(), wm_api.GetSplitViewController()->left_window()); 270 EXPECT_EQ(second.get(), wm_api.GetSplitViewController()->left_window());
272 EXPECT_EQ(third.get(), wm_api.GetSplitViewController()->right_window()); 271 EXPECT_EQ(third.get(), wm_api.GetSplitViewController()->right_window());
272 windows = wm_api.GetWindowListProvider()->GetWindowList();
273 ASSERT_EQ(4u, windows.size());
274 EXPECT_EQ(second.get(), windows[3]);
275 EXPECT_EQ(third.get(), windows[2]);
273 } 276 }
274 277
275 TEST_F(WindowManagerTest, NewWindowBounds) { 278 TEST_F(WindowManagerTest, NewWindowBounds) {
276 aura::test::TestWindowDelegate delegate; 279 aura::test::TestWindowDelegate delegate;
277 scoped_ptr<aura::Window> first(CreateWindow(&delegate)); 280 scoped_ptr<aura::Window> first(CreateWindow(&delegate));
278 281
279 test::WindowManagerImplTestApi wm_api; 282 test::WindowManagerImplTestApi wm_api;
280 aura::client::ParentWindowWithContext( 283 aura::client::ParentWindowWithContext(
281 first.get(), ScreenManager::Get()->GetContext(), gfx::Rect()); 284 first.get(), ScreenManager::Get()->GetContext(), gfx::Rect());
282 // The window should have the same size as the container. 285 // The window should have the same size as the container.
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 WindowOverviewModeDelegate* overview_delegate = wm_api.wm(); 363 WindowOverviewModeDelegate* overview_delegate = wm_api.wm();
361 overview_delegate->OnSelectWindow(w1.get()); 364 overview_delegate->OnSelectWindow(w1.get());
362 EXPECT_FALSE(wm_api.GetSplitViewController()->IsSplitViewModeActive()); 365 EXPECT_FALSE(wm_api.GetSplitViewController()->IsSplitViewModeActive());
363 EXPECT_TRUE(w1->IsVisible()); 366 EXPECT_TRUE(w1->IsVisible());
364 // Make sure the windows that were in split-view mode are hidden. 367 // Make sure the windows that were in split-view mode are hidden.
365 EXPECT_FALSE(w2->IsVisible()); 368 EXPECT_FALSE(w2->IsVisible());
366 EXPECT_FALSE(w3->IsVisible()); 369 EXPECT_FALSE(w3->IsVisible());
367 } 370 }
368 371
369 } // namespace athena 372 } // namespace athena
OLDNEW
« athena/wm/split_view_controller_unittest.cc ('K') | « athena/wm/split_view_controller_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698