OLD | NEW |
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/workspace/workspace_layout_manager.h" | 5 #include "ash/wm/workspace/workspace_layout_manager.h" |
6 | 6 |
7 #include "ash/root_window_controller.h" | 7 #include "ash/root_window_controller.h" |
8 #include "ash/screen_ash.h" | 8 #include "ash/screen_ash.h" |
9 #include "ash/shelf/shelf_layout_manager.h" | 9 #include "ash/shelf/shelf_layout_manager.h" |
10 #include "ash/shelf/shelf_widget.h" | 10 #include "ash/shelf/shelf_widget.h" |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 // doesn't effect the restore bounds. | 253 // doesn't effect the restore bounds. |
254 TEST_F(WorkspaceLayoutManagerTest, DontClobberRestoreBounds) { | 254 TEST_F(WorkspaceLayoutManagerTest, DontClobberRestoreBounds) { |
255 DontClobberRestoreBoundsWindowObserver window_observer; | 255 DontClobberRestoreBoundsWindowObserver window_observer; |
256 scoped_ptr<aura::Window> window(new aura::Window(NULL)); | 256 scoped_ptr<aura::Window> window(new aura::Window(NULL)); |
257 window->SetType(aura::client::WINDOW_TYPE_NORMAL); | 257 window->SetType(aura::client::WINDOW_TYPE_NORMAL); |
258 window->Init(ui::LAYER_TEXTURED); | 258 window->Init(ui::LAYER_TEXTURED); |
259 window->SetBounds(gfx::Rect(10, 20, 30, 40)); | 259 window->SetBounds(gfx::Rect(10, 20, 30, 40)); |
260 // NOTE: for this test to exercise the failure the observer needs to be added | 260 // NOTE: for this test to exercise the failure the observer needs to be added |
261 // before the parent set. This mimics what BrowserFrameAsh does. | 261 // before the parent set. This mimics what BrowserFrameAsh does. |
262 window->AddObserver(&window_observer); | 262 window->AddObserver(&window_observer); |
263 SetDefaultParentByPrimaryRootWindow(window.get()); | 263 ParentWindowInPrimaryRootWindow(window.get()); |
264 window->Show(); | 264 window->Show(); |
265 | 265 |
266 wm::WindowState* window_state = wm::GetWindowState(window.get()); | 266 wm::WindowState* window_state = wm::GetWindowState(window.get()); |
267 window_state->Activate(); | 267 window_state->Activate(); |
268 | 268 |
269 scoped_ptr<aura::Window> window2( | 269 scoped_ptr<aura::Window> window2( |
270 CreateTestWindowInShellWithBounds(gfx::Rect(12, 20, 30, 40))); | 270 CreateTestWindowInShellWithBounds(gfx::Rect(12, 20, 30, 40))); |
271 window->AddTransientChild(window2.get()); | 271 window->AddTransientChild(window2.get()); |
272 window2->Show(); | 272 window2->Show(); |
273 | 273 |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 window->bounds().ToString()); | 373 window->bounds().ToString()); |
374 | 374 |
375 // Directly setting the bounds triggers a slightly different code path. Verify | 375 // Directly setting the bounds triggers a slightly different code path. Verify |
376 // that too. | 376 // that too. |
377 window->SetBounds(window_bounds); | 377 window->SetBounds(window_bounds); |
378 EXPECT_EQ(gfx::Rect(gfx::Point(100, 101), work_area).ToString(), | 378 EXPECT_EQ(gfx::Rect(gfx::Point(100, 101), work_area).ToString(), |
379 window->bounds().ToString()); | 379 window->bounds().ToString()); |
380 } | 380 } |
381 | 381 |
382 } // namespace ash | 382 } // namespace ash |
OLD | NEW |