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

Side by Side Diff: chrome/browser/ui/ash/window_positioner_unittest.cc

Issue 1900443002: Removes aura dependencies from WindowPositioner (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nuke GetWorkAreaForWindowInParent and fix windows Created 4 years, 8 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
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/window_positioner.h" 5 #include "ash/wm/window_positioner.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "ash/test/ash_test_base.h" 9 #include "ash/test/ash_test_base.h"
10 #include "ash/test/test_shell_delegate.h" 10 #include "ash/test/test_shell_delegate.h"
11 #include "ash/wm/aura/wm_globals_aura.h"
11 #include "ash/wm/window_resizer.h" 12 #include "ash/wm/window_resizer.h"
12 #include "base/compiler_specific.h" 13 #include "base/compiler_specific.h"
13 #include "base/logging.h" 14 #include "base/logging.h"
14 #include "base/macros.h" 15 #include "base/macros.h"
15 #include "chrome/browser/ui/browser.h" 16 #include "chrome/browser/ui/browser.h"
16 #include "chrome/test/base/test_browser_window_aura.h" 17 #include "chrome/test/base/test_browser_window_aura.h"
17 #include "chrome/test/base/testing_profile.h" 18 #include "chrome/test/base/testing_profile.h"
18 #include "content/public/test/render_view_test.h" 19 #include "content/public/test/render_view_test.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"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 74
74 // Creating a browser for the popup. 75 // Creating a browser for the popup.
75 Browser::CreateParams popup_params(Browser::TYPE_POPUP, &profile_); 76 Browser::CreateParams popup_params(Browser::TYPE_POPUP, &profile_);
76 browser_popup_ = chrome::CreateBrowserWithAuraTestWindowForParams( 77 browser_popup_ = chrome::CreateBrowserWithAuraTestWindowForParams(
77 std::move(dummy_popup), &popup_params); 78 std::move(dummy_popup), &popup_params);
78 79
79 // We hide all windows upon start - each user is required to set it up 80 // We hide all windows upon start - each user is required to set it up
80 // as he needs it. 81 // as he needs it.
81 window()->Hide(); 82 window()->Hide();
82 popup()->Hide(); 83 popup()->Hide();
83 window_positioner_.reset(new WindowPositioner()); 84 window_positioner_.reset(new WindowPositioner(wm::WmGlobalsAura::Get()));
84 } 85 }
85 86
86 void WindowPositionerTest::TearDown() { 87 void WindowPositionerTest::TearDown() {
87 // Since the AuraTestBase is needed to create our assets, we have to 88 // Since the AuraTestBase is needed to create our assets, we have to
88 // also delete them before we tear it down. 89 // also delete them before we tear it down.
89 browser_.reset(); 90 browser_.reset();
90 browser_popup_.reset(); 91 browser_popup_.reset();
91 window_positioner_.reset(); 92 window_positioner_.reset();
92 AshTestBase::TearDown(); 93 AshTestBase::TearDown();
93 } 94 }
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 223
223 // Check that the popup is placed full screen. 224 // Check that the popup is placed full screen.
224 gfx::Rect full = window_positioner()->GetPopupPosition(pop_position); 225 gfx::Rect full = window_positioner()->GetPopupPosition(pop_position);
225 EXPECT_EQ(gfx::Rect(work_area.x(), work_area.y(), 226 EXPECT_EQ(gfx::Rect(work_area.x(), work_area.y(),
226 pop_position.width(), pop_position.height()), 227 pop_position.width(), pop_position.height()),
227 full); 228 full);
228 } 229 }
229 230
230 } // namespace test 231 } // namespace test
231 } // namespace ash 232 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/workspace/workspace_window_resizer_unittest.cc ('k') | chrome/browser/ui/window_sizer/window_sizer_ash.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698