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

Side by Side Diff: ash/shell_unittest.cc

Issue 10829173: Revert 149869 because it broke ash_unittests on win_aura and linux_chromeos. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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 | « ash/shell_factory.h ('k') | ash/shell_window_ids.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/ash_switches.h" 5 #include "ash/ash_switches.h"
6 #include "ash/desktop_background/desktop_background_widget_controller.h"
7 #include "ash/launcher/launcher.h" 6 #include "ash/launcher/launcher.h"
8 #include "ash/shell.h" 7 #include "ash/shell.h"
9 #include "ash/shell_delegate.h" 8 #include "ash/shell_delegate.h"
10 #include "ash/shell_window_ids.h" 9 #include "ash/shell_window_ids.h"
11 #include "ash/test/ash_test_base.h" 10 #include "ash/test/ash_test_base.h"
12 #include "ash/wm/root_window_layout_manager.h" 11 #include "ash/wm/root_window_layout_manager.h"
13 #include "ash/wm/shelf_layout_manager.h" 12 #include "ash/wm/shelf_layout_manager.h"
14 #include "base/utf_string_conversions.h" 13 #include "base/utf_string_conversions.h"
15 #include "ui/aura/client/aura_constants.h" 14 #include "ui/aura/client/aura_constants.h"
16 #include "ui/aura/root_window.h" 15 #include "ui/aura/root_window.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 root_window, internal::kShellWindowId_DefaultContainer)); 51 root_window, internal::kShellWindowId_DefaultContainer));
53 EXPECT_TRUE(Shell::GetContainer( 52 EXPECT_TRUE(Shell::GetContainer(
54 root_window, internal::kShellWindowId_AlwaysOnTopContainer)); 53 root_window, internal::kShellWindowId_AlwaysOnTopContainer));
55 EXPECT_TRUE(Shell::GetContainer( 54 EXPECT_TRUE(Shell::GetContainer(
56 root_window, internal::kShellWindowId_PanelContainer)); 55 root_window, internal::kShellWindowId_PanelContainer));
57 EXPECT_TRUE(Shell::GetContainer( 56 EXPECT_TRUE(Shell::GetContainer(
58 root_window, internal::kShellWindowId_LauncherContainer)); 57 root_window, internal::kShellWindowId_LauncherContainer));
59 EXPECT_TRUE(Shell::GetContainer( 58 EXPECT_TRUE(Shell::GetContainer(
60 root_window, internal::kShellWindowId_SystemModalContainer)); 59 root_window, internal::kShellWindowId_SystemModalContainer));
61 EXPECT_TRUE(Shell::GetContainer( 60 EXPECT_TRUE(Shell::GetContainer(
62 root_window, internal::kShellWindowId_LockScreenBackgroundContainer));
63 EXPECT_TRUE(Shell::GetContainer(
64 root_window, internal::kShellWindowId_LockScreenContainer)); 61 root_window, internal::kShellWindowId_LockScreenContainer));
65 EXPECT_TRUE(Shell::GetContainer( 62 EXPECT_TRUE(Shell::GetContainer(
66 root_window, internal::kShellWindowId_LockSystemModalContainer)); 63 root_window, internal::kShellWindowId_LockSystemModalContainer));
67 EXPECT_TRUE(Shell::GetContainer( 64 EXPECT_TRUE(Shell::GetContainer(
68 root_window, internal::kShellWindowId_StatusContainer)); 65 root_window, internal::kShellWindowId_StatusContainer));
69 EXPECT_TRUE(Shell::GetContainer( 66 EXPECT_TRUE(Shell::GetContainer(
70 root_window, internal::kShellWindowId_MenuContainer)); 67 root_window, internal::kShellWindowId_MenuContainer));
71 EXPECT_TRUE(Shell::GetContainer( 68 EXPECT_TRUE(Shell::GetContainer(
72 root_window, internal::kShellWindowId_DragImageAndTooltipContainer)); 69 root_window, internal::kShellWindowId_DragImageAndTooltipContainer));
73 EXPECT_TRUE(Shell::GetContainer( 70 EXPECT_TRUE(Shell::GetContainer(
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 // We have a default container event filter (for window drags). 264 // We have a default container event filter (for window drags).
268 EXPECT_TRUE(GetDefaultContainer()->event_filter()); 265 EXPECT_TRUE(GetDefaultContainer()->event_filter());
269 // Launcher is visible. 266 // Launcher is visible.
270 views::Widget* launcher_widget = shell->launcher()->widget(); 267 views::Widget* launcher_widget = shell->launcher()->widget();
271 EXPECT_TRUE(launcher_widget->IsVisible()); 268 EXPECT_TRUE(launcher_widget->IsVisible());
272 // Launcher is at bottom-left of screen. 269 // Launcher is at bottom-left of screen.
273 EXPECT_EQ(0, launcher_widget->GetWindowBoundsInScreen().x()); 270 EXPECT_EQ(0, launcher_widget->GetWindowBoundsInScreen().x());
274 EXPECT_EQ(Shell::GetPrimaryRootWindow()->GetHostSize().height(), 271 EXPECT_EQ(Shell::GetPrimaryRootWindow()->GetHostSize().height(),
275 launcher_widget->GetWindowBoundsInScreen().bottom()); 272 launcher_widget->GetWindowBoundsInScreen().bottom());
276 // We have a desktop background but not a bare layer. 273 // We have a desktop background but not a bare layer.
277 // TODO (antrim): enable once we find out why it fails component build. 274 EXPECT_TRUE(test_api.root_window_layout()->background_widget());
278 // internal::DesktopBackgroundWidgetController* background = 275 EXPECT_FALSE(test_api.root_window_layout()->background_layer());
279 // Shell::GetPrimaryRootWindow()->
280 // GetProperty(internal::kWindowDesktopComponent);
281 // EXPECT_TRUE(background);
282 // EXPECT_TRUE(background->widget());
283 // EXPECT_FALSE(background->layer());
284 276
285 // Create a normal window. It is not maximized. 277 // Create a normal window. It is not maximized.
286 views::Widget::InitParams widget_params( 278 views::Widget::InitParams widget_params(
287 views::Widget::InitParams::TYPE_WINDOW); 279 views::Widget::InitParams::TYPE_WINDOW);
288 widget_params.bounds.SetRect(11, 22, 300, 400); 280 widget_params.bounds.SetRect(11, 22, 300, 400);
289 views::Widget* widget = CreateTestWindow(widget_params); 281 views::Widget* widget = CreateTestWindow(widget_params);
290 widget->Show(); 282 widget->Show();
291 EXPECT_FALSE(widget->IsMaximized()); 283 EXPECT_FALSE(widget->IsMaximized());
292 284
293 // Clean up. 285 // Clean up.
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 private: 333 private:
342 DISALLOW_COPY_AND_ASSIGN(ShellTest2); 334 DISALLOW_COPY_AND_ASSIGN(ShellTest2);
343 }; 335 };
344 336
345 TEST_F(ShellTest2, DontCrashWhenWindowDeleted) { 337 TEST_F(ShellTest2, DontCrashWhenWindowDeleted) {
346 window_.reset(new aura::Window(NULL)); 338 window_.reset(new aura::Window(NULL));
347 window_->Init(ui::LAYER_NOT_DRAWN); 339 window_->Init(ui::LAYER_NOT_DRAWN);
348 } 340 }
349 341
350 } // namespace ash 342 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shell_factory.h ('k') | ash/shell_window_ids.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698