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

Side by Side Diff: ash/wm/panel_layout_manager_unittest.cc

Issue 11363250: Allow Chrome apps to create Ash Panels (apps v2) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix mac and win builds Created 8 years 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/wm/panel_layout_manager.h" 5 #include "ash/wm/panel_layout_manager.h"
6 6
7 #include "ash/ash_switches.h" 7 #include "ash/ash_switches.h"
8 #include "ash/launcher/launcher.h" 8 #include "ash/launcher/launcher.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/shell_window_ids.h" 10 #include "ash/shell_window_ids.h"
11 #include "ash/test/ash_test_base.h" 11 #include "ash/test/ash_test_base.h"
12 #include "ash/test/launcher_view_test_api.h" 12 #include "ash/test/launcher_view_test_api.h"
13 #include "ash/test/test_launcher_delegate.h" 13 #include "ash/test/test_launcher_delegate.h"
14 #include "ash/wm/window_util.h" 14 #include "ash/wm/window_util.h"
15 #include "base/basictypes.h" 15 #include "base/basictypes.h"
16 #include "base/command_line.h" 16 #include "base/command_line.h"
17 #include "base/compiler_specific.h" 17 #include "base/compiler_specific.h"
18 #include "ui/aura/client/aura_constants.h"
19 #include "ui/aura/test/test_windows.h"
18 #include "ui/aura/window.h" 20 #include "ui/aura/window.h"
19 #include "ui/aura/test/test_windows.h"
20 #include "ui/views/widget/widget.h" 21 #include "ui/views/widget/widget.h"
21 22
22 namespace ash { 23 namespace ash {
23 namespace internal { 24 namespace internal {
24 25
25 using aura::test::WindowIsAbove; 26 using aura::test::WindowIsAbove;
26 27
27 class PanelLayoutManagerTest : public ash::test::AshTestBase { 28 class PanelLayoutManagerTest : public ash::test::AshTestBase {
28 public: 29 public:
29 PanelLayoutManagerTest() {} 30 PanelLayoutManagerTest() {}
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 int window_x2 = w2->GetBoundsInRootWindow().x(); 291 int window_x2 = w2->GetBoundsInRootWindow().x();
291 int window_x3 = w3->GetBoundsInRootWindow().x(); 292 int window_x3 = w3->GetBoundsInRootWindow().x();
292 Launcher* launcher = Launcher::ForPrimaryDisplay(); 293 Launcher* launcher = Launcher::ForPrimaryDisplay();
293 int icon_x1 = launcher->GetScreenBoundsOfItemIconForWindow(w1.get()).x(); 294 int icon_x1 = launcher->GetScreenBoundsOfItemIconForWindow(w1.get()).x();
294 int icon_x2 = launcher->GetScreenBoundsOfItemIconForWindow(w2.get()).x(); 295 int icon_x2 = launcher->GetScreenBoundsOfItemIconForWindow(w2.get()).x();
295 EXPECT_EQ(window_x2 - window_x1, window_x3 - window_x2); 296 EXPECT_EQ(window_x2 - window_x1, window_x3 - window_x2);
296 int spacing = window_x2 - window_x1; 297 int spacing = window_x2 - window_x1;
297 EXPECT_GT(spacing, icon_x2 - icon_x1); 298 EXPECT_GT(spacing, icon_x2 - icon_x1);
298 } 299 }
299 300
301 TEST_F(PanelLayoutManagerTest, MinimizeRestorePanel) {
302 gfx::Rect bounds(0, 0, 201, 201);
303 scoped_ptr<aura::Window> window(CreatePanelWindow(bounds));
304 // Activate the window, ensure callout is visible.
305 wm::ActivateWindow(window.get());
306 RunAllPendingInMessageLoop();
307 EXPECT_TRUE(IsCalloutVisible());
308 // Minimize the panel, callout should be hidden.
309 window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MINIMIZED);
310 RunAllPendingInMessageLoop();
311 EXPECT_FALSE(IsCalloutVisible());
312 // Restore the pantel; panel should not be activated by default and callout
313 // should be hidden.
314 window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL);
315 RunAllPendingInMessageLoop();
316 EXPECT_FALSE(IsCalloutVisible());
317 // Activate the window, ensure callout is visible.
318 wm::ActivateWindow(window.get());
319 RunAllPendingInMessageLoop();
320 EXPECT_TRUE(IsCalloutVisible());
321 }
322
300 } // namespace internal 323 } // namespace internal
301 } // namespace ash 324 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/panel_layout_manager.cc ('k') | chrome/browser/extensions/api/app_window/app_window_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698