| 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 <algorithm> | 5 #include <algorithm> |
| 6 #include <set> | 6 #include <set> |
| 7 | 7 |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 1362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1373 Init(init_params); | 1373 Init(init_params); |
| 1374 | 1374 |
| 1375 View* contents_view = new View; | 1375 View* contents_view = new View; |
| 1376 contents_view->SetFocusable(true); | 1376 contents_view->SetFocusable(true); |
| 1377 SetContentsView(contents_view); | 1377 SetContentsView(contents_view); |
| 1378 | 1378 |
| 1379 Show(); | 1379 Show(); |
| 1380 Activate(); | 1380 Activate(); |
| 1381 } | 1381 } |
| 1382 | 1382 |
| 1383 TEST_F(WidgetTest, DesktopNativeWidgetNoPaintAfterCloseTest) { | 1383 #if defined(OS_LINUX) |
| 1384 // Flaky on Linux rel ng: https://crbug.com/596039. |
| 1385 #define MAYBE_DesktopNativeWidgetNoPaintAfterCloseTest DISABLED_DesktopNativeWid
getNoPaintAfterCloseTest |
| 1386 #else |
| 1387 #define MAYBE_DesktopNativeWidgetNoPaintAfterCloseTest DesktopNativeWidgetNoPain
tAfterCloseTest |
| 1388 #endif |
| 1389 |
| 1390 TEST_F(WidgetTest, MAYBE_DesktopNativeWidgetNoPaintAfterCloseTest) { |
| 1384 DesktopAuraTestValidPaintWidget widget; | 1391 DesktopAuraTestValidPaintWidget widget; |
| 1385 widget.InitForTest(CreateParams(Widget::InitParams::TYPE_WINDOW_FRAMELESS)); | 1392 widget.InitForTest(CreateParams(Widget::InitParams::TYPE_WINDOW_FRAMELESS)); |
| 1386 RunPendingMessages(); | 1393 RunPendingMessages(); |
| 1387 EXPECT_TRUE(widget.ReadReceivedPaintAndReset()); | 1394 EXPECT_TRUE(widget.ReadReceivedPaintAndReset()); |
| 1388 widget.SchedulePaintInRect(widget.GetRestoredBounds()); | 1395 widget.SchedulePaintInRect(widget.GetRestoredBounds()); |
| 1389 widget.Close(); | 1396 widget.Close(); |
| 1390 RunPendingMessages(); | 1397 RunPendingMessages(); |
| 1391 EXPECT_FALSE(widget.ReadReceivedPaintAndReset()); | 1398 EXPECT_FALSE(widget.ReadReceivedPaintAndReset()); |
| 1392 EXPECT_FALSE(widget.received_paint_while_hidden()); | 1399 EXPECT_FALSE(widget.received_paint_while_hidden()); |
| 1393 } | 1400 } |
| (...skipping 2115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3509 // Moving the child to a different widget should call the removals observer. | 3516 // Moving the child to a different widget should call the removals observer. |
| 3510 WidgetAutoclosePtr widget2(CreateTopLevelPlatformWidget()); | 3517 WidgetAutoclosePtr widget2(CreateTopLevelPlatformWidget()); |
| 3511 widget2->client_view()->AddChildView(child); | 3518 widget2->client_view()->AddChildView(child); |
| 3512 EXPECT_TRUE(removals_observer.DidRemoveView(child)); | 3519 EXPECT_TRUE(removals_observer.DidRemoveView(child)); |
| 3513 | 3520 |
| 3514 widget->RemoveRemovalsObserver(&removals_observer); | 3521 widget->RemoveRemovalsObserver(&removals_observer); |
| 3515 } | 3522 } |
| 3516 | 3523 |
| 3517 } // namespace test | 3524 } // namespace test |
| 3518 } // namespace views | 3525 } // namespace views |
| OLD | NEW |