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

Unified Diff: ui/wm/core/compound_event_filter_unittest.cc

Issue 1868363002: Replace scoped_ptr with std::unique_ptr in //ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scopedptrcc
Patch Set: scopedptrui: rebase-make_scoped_ptr Created 4 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
« no previous file with comments | « ui/wm/core/capture_controller_unittest.cc ('k') | ui/wm/core/cursor_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/wm/core/compound_event_filter_unittest.cc
diff --git a/ui/wm/core/compound_event_filter_unittest.cc b/ui/wm/core/compound_event_filter_unittest.cc
index 140dd4c0c67c01aacca2a57a68d504ce4f53c0ad..2305294c4d85f9de3023951a5fbbbd716f738608 100644
--- a/ui/wm/core/compound_event_filter_unittest.cc
+++ b/ui/wm/core/compound_event_filter_unittest.cc
@@ -53,11 +53,11 @@ typedef aura::test::AuraTestBase CompoundEventFilterTest;
#if defined(OS_CHROMEOS)
// A keypress only hides the cursor on ChromeOS (crbug.com/304296).
TEST_F(CompoundEventFilterTest, CursorVisibilityChange) {
- scoped_ptr<CompoundEventFilter> compound_filter(new CompoundEventFilter);
+ std::unique_ptr<CompoundEventFilter> compound_filter(new CompoundEventFilter);
aura::Env::GetInstance()->AddPreTargetHandler(compound_filter.get());
aura::test::TestWindowDelegate delegate;
- scoped_ptr<aura::Window> window(CreateTestWindowWithDelegate(&delegate, 1234,
- gfx::Rect(5, 5, 100, 100), root_window()));
+ std::unique_ptr<aura::Window> window(CreateTestWindowWithDelegate(
+ &delegate, 1234, gfx::Rect(5, 5, 100, 100), root_window()));
window->Show();
window->SetCapture();
@@ -114,11 +114,11 @@ TEST_F(CompoundEventFilterTest, CursorVisibilityChange) {
// Touch visually hides the cursor on ChromeOS and Windows.
TEST_F(CompoundEventFilterTest, TouchHidesCursor) {
new wm::DefaultActivationClient(root_window());
- scoped_ptr<CompoundEventFilter> compound_filter(new CompoundEventFilter);
+ std::unique_ptr<CompoundEventFilter> compound_filter(new CompoundEventFilter);
aura::Env::GetInstance()->AddPreTargetHandler(compound_filter.get());
aura::test::TestWindowDelegate delegate;
- scoped_ptr<aura::Window> window(CreateTestWindowWithDelegate(&delegate, 1234,
- gfx::Rect(5, 5, 100, 100), root_window()));
+ std::unique_ptr<aura::Window> window(CreateTestWindowWithDelegate(
+ &delegate, 1234, gfx::Rect(5, 5, 100, 100), root_window()));
window->Show();
window->SetCapture();
@@ -165,14 +165,15 @@ TEST_F(CompoundEventFilterTest, TouchHidesCursor) {
// Tests that if an event filter consumes a gesture, then it doesn't focus the
// window.
TEST_F(CompoundEventFilterTest, FilterConsumedGesture) {
- scoped_ptr<CompoundEventFilter> compound_filter(new CompoundEventFilter);
- scoped_ptr<ui::EventHandler> gesure_handler(new ConsumeGestureEventFilter);
+ std::unique_ptr<CompoundEventFilter> compound_filter(new CompoundEventFilter);
+ std::unique_ptr<ui::EventHandler> gesure_handler(
+ new ConsumeGestureEventFilter);
compound_filter->AddHandler(gesure_handler.get());
aura::Env::GetInstance()->AddPreTargetHandler(compound_filter.get());
aura::test::TestWindowDelegate delegate;
DCHECK(root_window());
- scoped_ptr<aura::Window> window(CreateTestWindowWithDelegate(&delegate, 1234,
- gfx::Rect(5, 5, 100, 100), root_window()));
+ std::unique_ptr<aura::Window> window(CreateTestWindowWithDelegate(
+ &delegate, 1234, gfx::Rect(5, 5, 100, 100), root_window()));
window->Show();
EXPECT_TRUE(window->CanFocus());
@@ -193,11 +194,11 @@ TEST_F(CompoundEventFilterTest, FilterConsumedGesture) {
TEST_F(CompoundEventFilterTest, DontHideWhenMouseDown) {
ui::test::EventGenerator event_generator(root_window());
- scoped_ptr<CompoundEventFilter> compound_filter(new CompoundEventFilter);
+ std::unique_ptr<CompoundEventFilter> compound_filter(new CompoundEventFilter);
aura::Env::GetInstance()->AddPreTargetHandler(compound_filter.get());
aura::test::TestWindowDelegate delegate;
- scoped_ptr<aura::Window> window(CreateTestWindowWithDelegate(&delegate, 1234,
- gfx::Rect(5, 5, 100, 100), root_window()));
+ std::unique_ptr<aura::Window> window(CreateTestWindowWithDelegate(
+ &delegate, 1234, gfx::Rect(5, 5, 100, 100), root_window()));
window->Show();
aura::test::TestCursorClient cursor_client(root_window());
@@ -220,11 +221,11 @@ TEST_F(CompoundEventFilterTest, DontHideWhenMouseDown) {
// Windows synthesizes mouse messages for touch events. We should not be
// showing the cursor when we receive such messages.
TEST_F(CompoundEventFilterTest, DontShowCursorOnMouseMovesFromTouch) {
- scoped_ptr<CompoundEventFilter> compound_filter(new CompoundEventFilter);
+ std::unique_ptr<CompoundEventFilter> compound_filter(new CompoundEventFilter);
aura::Env::GetInstance()->AddPreTargetHandler(compound_filter.get());
aura::test::TestWindowDelegate delegate;
- scoped_ptr<aura::Window> window(CreateTestWindowWithDelegate(&delegate, 1234,
- gfx::Rect(5, 5, 100, 100), root_window()));
+ std::unique_ptr<aura::Window> window(CreateTestWindowWithDelegate(
+ &delegate, 1234, gfx::Rect(5, 5, 100, 100), root_window()));
window->Show();
window->SetCapture();
« no previous file with comments | « ui/wm/core/capture_controller_unittest.cc ('k') | ui/wm/core/cursor_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698