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

Side by Side Diff: ash/shell_unittest.cc

Issue 11421006: Desktop aura: Break aura::Window::SetParent in two. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix ash_unittests 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
« no previous file with comments | « ash/root_window_controller_unittest.cc ('k') | ash/test/ash_test_base.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/shell.h" 5 #include "ash/shell.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "ash/ash_switches.h" 10 #include "ash/ash_switches.h"
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 352
353 } // namespace 353 } // namespace
354 354
355 // Various assertions around IsAutoHideMenuHideChecked() and 355 // Various assertions around IsAutoHideMenuHideChecked() and
356 // ToggleAutoHideMenu(). 356 // ToggleAutoHideMenu().
357 TEST_F(ShellTest, ToggleAutoHide) { 357 TEST_F(ShellTest, ToggleAutoHide) {
358 scoped_ptr<aura::Window> window(new aura::Window(NULL)); 358 scoped_ptr<aura::Window> window(new aura::Window(NULL));
359 window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL); 359 window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL);
360 window->SetType(aura::client::WINDOW_TYPE_NORMAL); 360 window->SetType(aura::client::WINDOW_TYPE_NORMAL);
361 window->Init(ui::LAYER_TEXTURED); 361 window->Init(ui::LAYER_TEXTURED);
362 window->SetParent(NULL); 362 SetDefaultParentByPrimaryRootWindow(window.get());
363 window->Show(); 363 window->Show();
364 wm::ActivateWindow(window.get()); 364 wm::ActivateWindow(window.get());
365 365
366 internal::RootWindowController* controller = 366 internal::RootWindowController* controller =
367 Shell::GetPrimaryRootWindowController(); 367 Shell::GetPrimaryRootWindowController();
368 controller->SetShelfAutoHideBehavior(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); 368 controller->SetShelfAutoHideBehavior(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
369 EXPECT_EQ(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS, 369 EXPECT_EQ(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS,
370 controller->GetShelfAutoHideBehavior()); 370 controller->GetShelfAutoHideBehavior());
371 EXPECT_TRUE(controller->IsShelfAutoHideMenuHideChecked()); 371 EXPECT_TRUE(controller->IsShelfAutoHideMenuHideChecked());
372 controller->SetShelfAutoHideBehavior( 372 controller->SetShelfAutoHideBehavior(
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 private: 405 private:
406 DISALLOW_COPY_AND_ASSIGN(ShellTest2); 406 DISALLOW_COPY_AND_ASSIGN(ShellTest2);
407 }; 407 };
408 408
409 TEST_F(ShellTest2, DontCrashWhenWindowDeleted) { 409 TEST_F(ShellTest2, DontCrashWhenWindowDeleted) {
410 window_.reset(new aura::Window(NULL)); 410 window_.reset(new aura::Window(NULL));
411 window_->Init(ui::LAYER_NOT_DRAWN); 411 window_->Init(ui::LAYER_NOT_DRAWN);
412 } 412 }
413 413
414 } // namespace ash 414 } // namespace ash
OLDNEW
« no previous file with comments | « ash/root_window_controller_unittest.cc ('k') | ash/test/ash_test_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698