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 "ui/aura/window.h" | 5 #include "ui/aura/window.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/stringprintf.h" | 9 #include "base/stringprintf.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 1247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1258 EXPECT_FALSE(window->IsVisible()); | 1258 EXPECT_FALSE(window->IsVisible()); |
1259 EXPECT_FALSE(window->layer()->visible()); | 1259 EXPECT_FALSE(window->layer()->visible()); |
1260 window->Show(); | 1260 window->Show(); |
1261 | 1261 |
1262 client.set_ignore_visibility_changes(true); | 1262 client.set_ignore_visibility_changes(true); |
1263 window->Hide(); | 1263 window->Hide(); |
1264 EXPECT_FALSE(window->IsVisible()); | 1264 EXPECT_FALSE(window->IsVisible()); |
1265 EXPECT_TRUE(window->layer()->visible()); | 1265 EXPECT_TRUE(window->layer()->visible()); |
1266 } | 1266 } |
1267 | 1267 |
| 1268 #if !defined(OS_WIN) |
| 1269 // Temporarily disabled for windows. See crbug.com/112222. |
| 1270 |
1268 // Tests mouse events on window change. | 1271 // Tests mouse events on window change. |
1269 // See http://crbug.com/112246 | 1272 TEST_F(WindowTest, MouseEventsOnWindowChange) { |
1270 TEST_F(WindowTest, FAILS_MouseEventsOnWindowChange) { | |
1271 RootWindow* root_window = RootWindow::GetInstance(); | 1273 RootWindow* root_window = RootWindow::GetInstance(); |
1272 gfx::Size size = root_window->GetHostSize(); | 1274 gfx::Size size = root_window->GetHostSize(); |
1273 | 1275 |
1274 EventGenerator generator; | 1276 EventGenerator generator; |
1275 generator.MoveMouseTo(50, 50); | 1277 generator.MoveMouseTo(50, 50); |
1276 | 1278 |
1277 MouseTrackingDelegate d1; | 1279 MouseTrackingDelegate d1; |
1278 scoped_ptr<Window> w1(CreateTestWindowWithDelegate(&d1, 1, | 1280 scoped_ptr<Window> w1(CreateTestWindowWithDelegate(&d1, 1, |
1279 gfx::Rect(0, 0, 100, 100), root_window)); | 1281 gfx::Rect(0, 0, 100, 100), root_window)); |
1280 RunAllPendingInMessageLoop(); | 1282 RunAllPendingInMessageLoop(); |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1335 w11->SetTransform(ui::Transform()); | 1337 w11->SetTransform(ui::Transform()); |
1336 RunAllPendingInMessageLoop(); | 1338 RunAllPendingInMessageLoop(); |
1337 EXPECT_EQ("0 0 1", d1.GetMouseCountsAndReset()); | 1339 EXPECT_EQ("0 0 1", d1.GetMouseCountsAndReset()); |
1338 EXPECT_EQ("1 1 0", d11.GetMouseCountsAndReset()); | 1340 EXPECT_EQ("1 1 0", d11.GetMouseCountsAndReset()); |
1339 | 1341 |
1340 // Closing a window. | 1342 // Closing a window. |
1341 w11.reset(); | 1343 w11.reset(); |
1342 RunAllPendingInMessageLoop(); | 1344 RunAllPendingInMessageLoop(); |
1343 EXPECT_EQ("1 1 0", d1.GetMouseCountsAndReset()); | 1345 EXPECT_EQ("1 1 0", d1.GetMouseCountsAndReset()); |
1344 } | 1346 } |
| 1347 #endif |
1345 | 1348 |
1346 class StackingMadrigalLayoutManager : public LayoutManager { | 1349 class StackingMadrigalLayoutManager : public LayoutManager { |
1347 public: | 1350 public: |
1348 StackingMadrigalLayoutManager() { | 1351 StackingMadrigalLayoutManager() { |
1349 RootWindow::GetInstance()->SetLayoutManager(this); | 1352 RootWindow::GetInstance()->SetLayoutManager(this); |
1350 } | 1353 } |
1351 virtual ~StackingMadrigalLayoutManager() { | 1354 virtual ~StackingMadrigalLayoutManager() { |
1352 } | 1355 } |
1353 | 1356 |
1354 private: | 1357 private: |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1551 | 1554 |
1552 w1.reset(); // Deletes w11 and w111. | 1555 w1.reset(); // Deletes w11 and w111. |
1553 w11 = NULL; | 1556 w11 = NULL; |
1554 w111 = NULL; | 1557 w111 = NULL; |
1555 EXPECT_EQ(2, observer.added_count()); | 1558 EXPECT_EQ(2, observer.added_count()); |
1556 EXPECT_EQ(2, observer.removed_count()); | 1559 EXPECT_EQ(2, observer.removed_count()); |
1557 } | 1560 } |
1558 | 1561 |
1559 } // namespace test | 1562 } // namespace test |
1560 } // namespace aura | 1563 } // namespace aura |
OLD | NEW |