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

Unified Diff: ash/host/ash_window_tree_host_x11_unittest.cc

Issue 25108005: linux_aura: Compile ash into chrome. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix win64 compile. Created 6 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 side-by-side diff with in-line comments
Download patch
Index: ash/host/ash_window_tree_host_x11_unittest.cc
diff --git a/ash/host/ash_window_tree_host_x11_unittest.cc b/ash/host/ash_window_tree_host_x11_unittest.cc
index efd25c04e26e5fb849f5fd2e9f288aa7460f12e5..2900ae3d518eefd1cb8fb9e1750f421793249171 100644
--- a/ash/host/ash_window_tree_host_x11_unittest.cc
+++ b/ash/host/ash_window_tree_host_x11_unittest.cc
@@ -56,16 +56,35 @@ class RootWindowEventHandler : public ui::EventHandler {
namespace ash {
-typedef aura::test::AuraTestBase WindowTreeHostX11Test;
+class WindowTreeHostX11Test : public aura::test::AuraTestBase {
+ public:
+ virtual void SetUp() OVERRIDE {
+ aura::test::AuraTestBase::SetUp();
+
+#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 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();
@@ -112,22 +131,12 @@ TEST_F(WindowTreeHostX11Test, DispatchTouchEventToOneRootWindow) {
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(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();
@@ -226,12 +235,6 @@ TEST_F(WindowTreeHostX11Test, DispatchTouchEventToTwoRootWindow) {
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
« no previous file with comments | « ash/host/ash_window_tree_host_x11.cc ('k') | build/common.gypi » ('j') | build/common.gypi » ('J')

Powered by Google App Engine
This is Rietveld 408576698