| Index: trunk/src/ash/host/ash_window_tree_host_x11_unittest.cc
|
| ===================================================================
|
| --- trunk/src/ash/host/ash_window_tree_host_x11_unittest.cc (revision 269901)
|
| +++ trunk/src/ash/host/ash_window_tree_host_x11_unittest.cc (working copy)
|
| @@ -56,35 +56,16 @@
|
|
|
| namespace ash {
|
|
|
| -class AshWindowTreeHostX11Test : public aura::test::AuraTestBase {
|
| - public:
|
| - virtual void SetUp() OVERRIDE {
|
| - aura::test::AuraTestBase::SetUp();
|
| +typedef aura::test::AuraTestBase WindowTreeHostX11Test;
|
|
|
| -#if defined(OS_CHROMEOS)
|
| - // Fake a ChromeOS running env.
|
| - const char* kLsbRelease = "CHROMEOS_RELEASE_NAME=Chromium OS\n";
|
| - base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease, base::Time());
|
| -#endif
|
| - }
|
| -
|
| - virtual void TearDown() OVERRIDE {
|
| - aura::test::AuraTestBase::TearDown();
|
| -
|
| -#if defined(OS_CHROMEOS)
|
| - // Revert the CrOS testing env otherwise the following non-CrOS aura
|
| - // tests will fail.
|
| - // Fake a ChromeOS running env.
|
| - const char* kLsbRelease = "";
|
| - base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease, base::Time());
|
| -#endif
|
| - }
|
| -};
|
| -
|
| // Send X touch events to one WindowTreeHost. The WindowTreeHost's
|
| // delegate will get corresponding ui::TouchEvent if the touch events
|
| -// are targeting this WindowTreeHost.
|
| -TEST_F(AshWindowTreeHostX11Test, DispatchTouchEventToOneRootWindow) {
|
| +// are winthin the bound of the WindowTreeHost.
|
| +TEST_F(WindowTreeHostX11Test, DispatchTouchEventToOneRootWindow) {
|
| + // Fake a ChromeOS running env.
|
| + const char* kLsbRelease = "CHROMEOS_RELEASE_NAME=Chromium OS\n";
|
| + base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease, base::Time());
|
| +
|
| scoped_ptr<AshWindowTreeHostX11> window_tree_host(
|
| new AshWindowTreeHostX11(gfx::Rect(0, 0, 2560, 1700)));
|
| window_tree_host->InitHost();
|
| @@ -131,12 +112,22 @@
|
| EXPECT_EQ(gfx::Point(1500, 1600), handler->last_touch_location());
|
|
|
| handler.reset();
|
| +
|
| + // Revert the CrOS testing env otherwise the following non-CrOS aura
|
| + // tests will fail.
|
| + // Fake a ChromeOS running env.
|
| + kLsbRelease = "";
|
| + base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease, base::Time());
|
| }
|
|
|
| // Send X touch events to two WindowTreeHost. The WindowTreeHost which is
|
| // the event target of the X touch events should generate the corresponding
|
| // ui::TouchEvent for its delegate.
|
| -TEST_F(AshWindowTreeHostX11Test, DispatchTouchEventToTwoRootWindow) {
|
| +TEST_F(WindowTreeHostX11Test, DispatchTouchEventToTwoRootWindow) {
|
| + // Fake a ChromeOS running env.
|
| + const char* kLsbRelease = "CHROMEOS_RELEASE_NAME=Chromium OS\n";
|
| + base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease, base::Time());
|
| +
|
| scoped_ptr<AshWindowTreeHostX11> window_tree_host1(
|
| new AshWindowTreeHostX11(gfx::Rect(0, 0, 2560, 1700)));
|
| window_tree_host1->InitHost();
|
| @@ -235,6 +226,12 @@
|
|
|
| handler1.reset();
|
| handler2.reset();
|
| +
|
| + // Revert the CrOS testing env otherwise the following non-CrOS aura
|
| + // tests will fail.
|
| + // Fake a ChromeOS running env.
|
| + kLsbRelease = "";
|
| + base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease, base::Time());
|
| }
|
|
|
| } // namespace aura
|
|
|