diff options
author | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-14 10:10:58 +0000 |
---|---|---|
committer | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-14 10:10:58 +0000 |
commit | 6bdf795e8f7dcfe80dd33b06bab229fd8a4d49f9 (patch) | |
tree | 842af6ec5fd894feb6b1d6cad3c38c4682966c57 /ash/test | |
parent | 647aeccd73b8598e1373987d34e7f16a6d5b39b7 (diff) | |
download | chromium_src-6bdf795e8f7dcfe80dd33b06bab229fd8a4d49f9.zip chromium_src-6bdf795e8f7dcfe80dd33b06bab229fd8a4d49f9.tar.gz chromium_src-6bdf795e8f7dcfe80dd33b06bab229fd8a4d49f9.tar.bz2 |
- Move DisplayManager and DisplayChangeObserverX11 from aura
to ash.DisplayManager/DisplayChangeObserverX11 are in aura for
historical reason, but they no longer have to be in aura.
* Remove SingleDisplayManager as it's no longer necessary.
* Rename MultipleDisplayManager and consolidate into DisplayManager.
* Remove DisplayManager from desktop environment. Screen
information is managed by platform in desktop environment, and
should be provided via gfx::Screen implementation.
- Move DisplayObserver to ui/gfx. This should be consolicated
with other similar features such as WorkAreaWatcherObserver/
DisplaySettingsProvider. It's tracked in crbug.com/122863.
- Misc cleanups
* Test should use test_support_ash instead of including
individual files.
* Use TestScreen where appropriate.
BUG=159710, 122863
TEST=none
Review URL: https://chromiumcodereview.appspot.com/11363124
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167639 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/test')
-rw-r--r-- | ash/test/ash_test_base.cc | 17 | ||||
-rw-r--r-- | ash/test/ash_test_base.h | 4 | ||||
-rw-r--r-- | ash/test/display_manager_test_api.cc (renamed from ash/test/multi_display_manager_test_api.cc) | 16 | ||||
-rw-r--r-- | ash/test/display_manager_test_api.h (renamed from ash/test/multi_display_manager_test_api.h) | 19 |
4 files changed, 25 insertions, 31 deletions
diff --git a/ash/test/ash_test_base.cc b/ash/test/ash_test_base.cc index 870c259..eaa2288 100644 --- a/ash/test/ash_test_base.cc +++ b/ash/test/ash_test_base.cc @@ -8,14 +8,13 @@ #include <vector> #include "ash/display/display_controller.h" -#include "ash/display/multi_display_manager.h" +#include "ash/display/display_manager.h" #include "ash/shell.h" -#include "ash/test/multi_display_manager_test_api.h" +#include "ash/test/display_manager_test_api.h" #include "ash/test/test_shell_delegate.h" #include "base/run_loop.h" #include "content/public/test/web_contents_tester.h" #include "ui/aura/env.h" -#include "ui/aura/display_manager.h" #include "ui/aura/root_window.h" #include "ui/base/ime/text_input_test_support.h" #include "ui/compositor/layer_animator.h" @@ -70,17 +69,13 @@ void AshTestBase::ChangeDisplayConfig(float scale, display.SetScaleAndBounds(scale, bounds_in_pixel); std::vector<gfx::Display> displays; displays.push_back(display); - aura::Env::GetInstance()->display_manager()->OnNativeDisplaysChanged( - displays); + Shell::GetInstance()->display_manager()->OnNativeDisplaysChanged(displays); } void AshTestBase::UpdateDisplay(const std::string& display_specs) { - internal::MultiDisplayManager* multi_display_manager = - static_cast<internal::MultiDisplayManager*>( - aura::Env::GetInstance()->display_manager()); - MultiDisplayManagerTestApi multi_display_manager_test_api( - multi_display_manager); - multi_display_manager_test_api.UpdateDisplay(display_specs); + DisplayManagerTestApi display_manager_test_api( + Shell::GetInstance()->display_manager()); + display_manager_test_api.UpdateDisplay(display_specs); } void AshTestBase::RunAllPendingInMessageLoop() { diff --git a/ash/test/ash_test_base.h b/ash/test/ash_test_base.h index b5007e5..e21225a 100644 --- a/ash/test/ash_test_base.h +++ b/ash/test/ash_test_base.h @@ -15,7 +15,7 @@ namespace ash { namespace internal { -class MultiDisplayManager; +class DisplayManager; } // internal namespace test { @@ -46,7 +46,7 @@ class AshTestBase : public testing::Test { void ChangeDisplayConfig(float scale, const gfx::Rect& bounds); // Update the display configuration as given in |display_specs|. - // See ash::test::MultiDisplayManagerTestApi::UpdateDisplay for more details. + // See ash::test::DisplayManagerTestApi::UpdateDisplay for more details. void UpdateDisplay(const std::string& display_specs); protected: diff --git a/ash/test/multi_display_manager_test_api.cc b/ash/test/display_manager_test_api.cc index 9d35016..f068b64 100644 --- a/ash/test/multi_display_manager_test_api.cc +++ b/ash/test/display_manager_test_api.cc @@ -2,13 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ash/test/multi_display_manager_test_api.h" +#include "ash/test/display_manager_test_api.h" #include <vector> -#include "ash/display/multi_display_manager.h" +#include "ash/display/display_manager.h" #include "ash/shell.h" #include "base/string_split.h" +#include "ui/aura/display_util.h" #include "ui/aura/root_window.h" #include "ui/gfx/display.h" @@ -23,21 +24,21 @@ std::vector<gfx::Display> CreateDisplaysFromString( base::SplitString(specs, ',', &parts); for (std::vector<std::string>::const_iterator iter = parts.begin(); iter != parts.end(); ++iter) { - displays.push_back(aura::DisplayManager::CreateDisplayFromSpec(*iter)); + displays.push_back(aura::CreateDisplayFromSpec(*iter)); } return displays; } } // namespace -MultiDisplayManagerTestApi::MultiDisplayManagerTestApi( - internal::MultiDisplayManager* display_manager) +DisplayManagerTestApi::DisplayManagerTestApi( + internal::DisplayManager* display_manager) : display_manager_(display_manager) { } -MultiDisplayManagerTestApi::~MultiDisplayManagerTestApi() {} +DisplayManagerTestApi::~DisplayManagerTestApi() {} -void MultiDisplayManagerTestApi::UpdateDisplay( +void DisplayManagerTestApi::UpdateDisplay( const std::string& display_specs) { std::vector<gfx::Display> displays = CreateDisplaysFromString(display_specs); display_manager_->SetDisplayIdsForTest(&displays); @@ -66,6 +67,5 @@ void MultiDisplayManagerTestApi::UpdateDisplay( } } - } // namespace test } // namespace ash diff --git a/ash/test/multi_display_manager_test_api.h b/ash/test/display_manager_test_api.h index 9b23267..57e961d 100644 --- a/ash/test/multi_display_manager_test_api.h +++ b/ash/test/display_manager_test_api.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef ASH_TEST_MULTI_DISPLAY_MANAGER_TEST_API_H_ -#define ASH_TEST_MULTI_DISPLAY_MANAGER_TEST_API_H_ +#ifndef ASH_TEST_DISPLAY_MANAGER_TEST_API_H_ +#define ASH_TEST_DISPLAY_MANAGER_TEST_API_H_ #include <string> @@ -11,16 +11,15 @@ namespace ash { namespace internal { -class MultiDisplayManager; +class DisplayManager; } // internal namespace test { -class MultiDisplayManagerTestApi { +class DisplayManagerTestApi { public: - explicit MultiDisplayManagerTestApi( - internal::MultiDisplayManager* display_manager); - virtual ~MultiDisplayManagerTestApi(); + explicit DisplayManagerTestApi(internal::DisplayManager* display_manager); + virtual ~DisplayManagerTestApi(); // Update the display configuration as given in |display_specs|. The format of // |display_spec| is a list of comma separated spec for each displays. Please @@ -29,12 +28,12 @@ class MultiDisplayManagerTestApi { void UpdateDisplay(const std::string& display_specs); private: - internal::MultiDisplayManager* display_manager_; // not owned + internal::DisplayManager* display_manager_; // not owned - DISALLOW_COPY_AND_ASSIGN(MultiDisplayManagerTestApi); + DISALLOW_COPY_AND_ASSIGN(DisplayManagerTestApi); }; } // namespace test } // namespace ash -#endif // ASH_TEST_MULTI_DISPLAY_MANAGER_TEST_API_H_ +#endif // ASH_TEST_DISPLAY_MANAGER_TEST_API_H_ |