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

Side by Side Diff: ui/views/widget/widget_interactive_uitest.cc

Issue 2593613003: Fix use-after-free in WidgetCaptureTest.SetCaptureToNonToplevel. (Closed)
Patch Set: Created 3 years, 12 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 1539 matching lines...) Expand 10 before | Expand all | Expand 10 after
1550 #if defined(OS_MACOSX) && !defined(USE_AURA) 1550 #if defined(OS_MACOSX) && !defined(USE_AURA)
1551 // On Mac, activation is asynchronous. A single trip to the runloop should be 1551 // On Mac, activation is asynchronous. A single trip to the runloop should be
1552 // sufficient. On Aura platforms, note that since the child widget isn't top- 1552 // sufficient. On Aura platforms, note that since the child widget isn't top-
1553 // level, the aura window manager gets asked whether the widget is active, not 1553 // level, the aura window manager gets asked whether the widget is active, not
1554 // the OS. 1554 // the OS.
1555 base::RunLoop().RunUntilIdle(); 1555 base::RunLoop().RunUntilIdle();
1556 #endif 1556 #endif
1557 1557
1558 EXPECT_TRUE(observer.activation_observed()); 1558 EXPECT_TRUE(observer.activation_observed());
1559 EXPECT_TRUE(child->HasCapture()); 1559 EXPECT_TRUE(child->HasCapture());
1560
1561 child->RemoveObserver(&observer);
1560 } 1562 }
1561 1563
1562 1564
1563 #if defined(OS_WIN) 1565 #if defined(OS_WIN)
1564 namespace { 1566 namespace {
1565 1567
1566 // Used to verify OnMouseEvent() has been invoked. 1568 // Used to verify OnMouseEvent() has been invoked.
1567 class MouseEventTrackingWidget : public Widget { 1569 class MouseEventTrackingWidget : public Widget {
1568 public: 1570 public:
1569 MouseEventTrackingWidget() : got_mouse_event_(false) {} 1571 MouseEventTrackingWidget() : got_mouse_event_(false) {}
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
1822 1824
1823 ui::KeyEvent key_event2(key_event); 1825 ui::KeyEvent key_event2(key_event);
1824 widget->OnKeyEvent(&key_event2); 1826 widget->OnKeyEvent(&key_event2);
1825 EXPECT_FALSE(key_event2.stopped_propagation()); 1827 EXPECT_FALSE(key_event2.stopped_propagation());
1826 1828
1827 widget->CloseNow(); 1829 widget->CloseNow();
1828 } 1830 }
1829 1831
1830 } // namespace test 1832 } // namespace test
1831 } // namespace views 1833 } // namespace views
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698