| 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 "chrome/browser/ui/ash/window_positioner.h" | 5 #include "chrome/browser/ui/ash/window_positioner.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/test/ash_test_base.h" | 8 #include "ash/test/ash_test_base.h" |
| 9 #include "ash/test/test_shell_delegate.h" | 9 #include "ash/test/test_shell_delegate.h" |
| 10 #include "ash/wm/window_resizer.h" | 10 #include "ash/wm/window_resizer.h" |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "chrome/browser/ui/browser.h" | 13 #include "chrome/browser/ui/browser.h" |
| 14 #include "chrome/browser/ui/host_desktop.h" | 14 #include "chrome/browser/ui/host_desktop.h" |
| 15 #include "chrome/test/base/test_browser_window.h" | 15 #include "chrome/test/base/test_browser_window.h" |
| 16 #include "chrome/test/base/testing_profile.h" | 16 #include "chrome/test/base/testing_profile.h" |
| 17 #include "content/public/browser/browser_thread.h" | 17 #include "content/public/browser/browser_thread.h" |
| 18 #include "content/public/test/render_view_test.h" | 18 #include "content/public/test/render_view_test.h" |
| 19 #include "content/public/test/test_renderer_host.h" |
| 19 #include "testing/gtest/include/gtest/gtest.h" | 20 #include "testing/gtest/include/gtest/gtest.h" |
| 20 #include "ui/aura/env.h" | 21 #include "ui/aura/env.h" |
| 21 #include "ui/aura/root_window.h" | 22 #include "ui/aura/root_window.h" |
| 22 #include "ui/aura/test/test_windows.h" | 23 #include "ui/aura/test/test_windows.h" |
| 23 #include "ui/gfx/screen.h" | 24 #include "ui/gfx/screen.h" |
| 24 | 25 |
| 25 namespace ash { | 26 namespace ash { |
| 26 namespace test { | 27 namespace test { |
| 27 | 28 |
| 28 namespace { | 29 namespace { |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 Browser* popup_browser() { return popup_owning_browser_.get(); } | 71 Browser* popup_browser() { return popup_owning_browser_.get(); } |
| 71 | 72 |
| 72 WindowPositioner* window_positioner() { return window_positioner_; } | 73 WindowPositioner* window_positioner() { return window_positioner_; } |
| 73 | 74 |
| 74 // The positioner & desktop's used grid alignment size. | 75 // The positioner & desktop's used grid alignment size. |
| 75 const int grid_size_; | 76 const int grid_size_; |
| 76 | 77 |
| 77 private: | 78 private: |
| 78 WindowPositioner* window_positioner_; | 79 WindowPositioner* window_positioner_; |
| 79 | 80 |
| 81 // The existence of this object enables tests via |
| 82 // RenderViewHostTester. |
| 83 content::RenderViewHostTestEnabler rvh_test_enabler_; |
| 84 |
| 80 // These two need to be deleted after everything else is gone. | 85 // These two need to be deleted after everything else is gone. |
| 81 TestingProfile profile_; | 86 TestingProfile profile_; |
| 82 | 87 |
| 83 // These get created for each session. | 88 // These get created for each session. |
| 84 scoped_ptr<aura::Window> window_; | 89 scoped_ptr<aura::Window> window_; |
| 85 scoped_ptr<aura::Window> popup_; | 90 scoped_ptr<aura::Window> popup_; |
| 86 | 91 |
| 87 scoped_ptr<BrowserWindow> browser_window_; | 92 scoped_ptr<BrowserWindow> browser_window_; |
| 88 scoped_ptr<BrowserWindow> browser_popup_; | 93 scoped_ptr<BrowserWindow> browser_popup_; |
| 89 | 94 |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 | 279 |
| 275 // Check that the popup is placed full screen. | 280 // Check that the popup is placed full screen. |
| 276 gfx::Rect full = window_positioner()->GetPopupPosition(pop_position); | 281 gfx::Rect full = window_positioner()->GetPopupPosition(pop_position); |
| 277 EXPECT_EQ(gfx::Rect(work_area.x(), work_area.y(), | 282 EXPECT_EQ(gfx::Rect(work_area.x(), work_area.y(), |
| 278 pop_position.width(), pop_position.height()), | 283 pop_position.width(), pop_position.height()), |
| 279 full); | 284 full); |
| 280 } | 285 } |
| 281 | 286 |
| 282 } // namespace test | 287 } // namespace test |
| 283 } // namespace ash | 288 } // namespace ash |
| OLD | NEW |