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

Side by Side Diff: ash/shelf/shelf_layout_manager_unittest.cc

Issue 149493008: Use active window if on current workspace for fullscreen mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update fullscreen state tracking in workspace and only consider switchable containers for active no… Created 6 years, 10 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ash/shelf/shelf_layout_manager.h" 5 #include "ash/shelf/shelf_layout_manager.h"
6 6
7 #include "ash/accelerators/accelerator_controller.h" 7 #include "ash/accelerators/accelerator_controller.h"
8 #include "ash/accelerators/accelerator_table.h" 8 #include "ash/accelerators/accelerator_table.h"
9 #include "ash/ash_switches.h" 9 #include "ash/ash_switches.h"
10 #include "ash/display/display_manager.h" 10 #include "ash/display/display_manager.h"
(...skipping 1291 matching lines...) Expand 10 before | Expand all | Expand 10 after
1302 Shell* shell = Shell::GetInstance(); 1302 Shell* shell = Shell::GetInstance();
1303 ShelfLayoutManager* shelf = GetShelfLayoutManager(); 1303 ShelfLayoutManager* shelf = GetShelfLayoutManager();
1304 // For shelf to be visible, app list is not open in initial state. 1304 // For shelf to be visible, app list is not open in initial state.
1305 shelf->LayoutShelf(); 1305 shelf->LayoutShelf();
1306 1306
1307 // Create a window and make it full screen. 1307 // Create a window and make it full screen.
1308 aura::Window* window = CreateTestWindow(); 1308 aura::Window* window = CreateTestWindow();
1309 window->SetBounds(gfx::Rect(0, 0, 100, 100)); 1309 window->SetBounds(gfx::Rect(0, 0, 100, 100));
1310 window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN); 1310 window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN);
1311 window->Show(); 1311 window->Show();
1312 wm::ActivateWindow(window); 1312 wm::GetWindowState(window)->Activate();
1313 1313
1314 // App list and shelf is not shown. 1314 // App list and shelf is not shown.
1315 EXPECT_FALSE(shell->GetAppListTargetVisibility()); 1315 EXPECT_FALSE(shell->GetAppListTargetVisibility());
1316 EXPECT_EQ(SHELF_HIDDEN, shelf->visibility_state()); 1316 EXPECT_EQ(SHELF_HIDDEN, shelf->visibility_state());
1317 1317
1318 // Toggle app list to show. 1318 // Toggle app list to show.
1319 shell->ToggleAppList(NULL); 1319 shell->ToggleAppList(NULL);
1320 EXPECT_TRUE(shell->GetAppListTargetVisibility()); 1320 EXPECT_TRUE(shell->GetAppListTargetVisibility());
1321 EXPECT_EQ(SHELF_HIDDEN, shelf->visibility_state()); 1321 EXPECT_EQ(SHELF_HIDDEN, shelf->visibility_state());
1322 1322
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
1363 Shell::RootWindowControllerList root_window_controllers = 1363 Shell::RootWindowControllerList root_window_controllers =
1364 Shell::GetAllRootWindowControllers(); 1364 Shell::GetAllRootWindowControllers();
1365 1365
1366 // Create windows on either display. 1366 // Create windows on either display.
1367 aura::Window* window1 = CreateTestWindow(); 1367 aura::Window* window1 = CreateTestWindow();
1368 window1->SetBoundsInScreen( 1368 window1->SetBoundsInScreen(
1369 gfx::Rect(0, 0, 100, 100), 1369 gfx::Rect(0, 0, 100, 100),
1370 display_manager->GetDisplayAt(0)); 1370 display_manager->GetDisplayAt(0));
1371 window1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN); 1371 window1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN);
1372 window1->Show(); 1372 window1->Show();
1373 wm::GetWindowState(window1)->Activate();
oshima 2014/02/14 17:24:26 Does this mean that when we create a single window
flackr 2014/02/14 20:00:02 Correct. This may be to prevent stealing input foc
oshima 2014/02/14 20:09:30 We probably should investigate what's the ideal be
1373 1374
1374 aura::Window* window2 = CreateTestWindow(); 1375 aura::Window* window2 = CreateTestWindow();
1375 window2->SetBoundsInScreen( 1376 window2->SetBoundsInScreen(
1376 gfx::Rect(800, 0, 100, 100), 1377 gfx::Rect(800, 0, 100, 100),
1377 display_manager->GetDisplayAt(1)); 1378 display_manager->GetDisplayAt(1));
1378 window2->Show(); 1379 window2->Show();
1379 1380
1380 EXPECT_EQ(root_windows[0], window1->GetRootWindow()); 1381 EXPECT_EQ(root_windows[0], window1->GetRootWindow());
1381 EXPECT_EQ(root_windows[1], window2->GetRootWindow()); 1382 EXPECT_EQ(root_windows[1], window2->GetRootWindow());
1382 1383
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after
1920 shelf->SetAlignment(SHELF_ALIGNMENT_LEFT); 1921 shelf->SetAlignment(SHELF_ALIGNMENT_LEFT);
1921 EXPECT_FALSE(status_area_widget->IsMessageBubbleShown()); 1922 EXPECT_FALSE(status_area_widget->IsMessageBubbleShown());
1922 generator.ClickLeftButton(); 1923 generator.ClickLeftButton();
1923 EXPECT_TRUE(status_area_widget->IsMessageBubbleShown()); 1924 EXPECT_TRUE(status_area_widget->IsMessageBubbleShown());
1924 generator.ClickLeftButton(); 1925 generator.ClickLeftButton();
1925 EXPECT_FALSE(status_area_widget->IsMessageBubbleShown()); 1926 EXPECT_FALSE(status_area_widget->IsMessageBubbleShown());
1926 } 1927 }
1927 1928
1928 } // namespace internal 1929 } // namespace internal
1929 } // namespace ash 1930 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698