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

Unified Diff: ash/drag_drop/drag_drop_tracker_unittest.cc

Issue 1867223004: Convert //ash from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments 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 | « ash/drag_drop/drag_drop_tracker.h ('k') | ash/drag_drop/drag_image_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/drag_drop/drag_drop_tracker_unittest.cc
diff --git a/ash/drag_drop/drag_drop_tracker_unittest.cc b/ash/drag_drop/drag_drop_tracker_unittest.cc
index 0e4bfa1ec421990d71f94fd3aa71ca0d1133c4f5..339b97f3ddd34a11cb293fbc0ac2ae07066f3419 100644
--- a/ash/drag_drop/drag_drop_tracker_unittest.cc
+++ b/ash/drag_drop/drag_drop_tracker_unittest.cc
@@ -4,10 +4,11 @@
#include "ash/drag_drop/drag_drop_tracker.h"
+#include <memory>
+
#include "ash/shell.h"
#include "ash/shell_window_ids.h"
#include "ash/test/ash_test_base.h"
-#include "base/memory/scoped_ptr.h"
#include "ui/aura/test/test_windows.h"
#include "ui/aura/window.h"
#include "ui/aura/window_event_dispatcher.h"
@@ -29,7 +30,7 @@ class DragDropTrackerTest : public test::AshTestBase {
}
static aura::Window* GetTarget(const gfx::Point& location) {
- scoped_ptr<DragDropTracker> tracker(
+ std::unique_ptr<DragDropTracker> tracker(
new DragDropTracker(Shell::GetPrimaryRootWindow(), NULL));
ui::MouseEvent e(ui::ET_MOUSE_DRAGGED, location, location,
ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE);
@@ -39,7 +40,7 @@ class DragDropTrackerTest : public test::AshTestBase {
static ui::LocatedEvent* ConvertEvent(aura::Window* target,
const ui::MouseEvent& event) {
- scoped_ptr<DragDropTracker> tracker(
+ std::unique_ptr<DragDropTracker> tracker(
new DragDropTracker(Shell::GetPrimaryRootWindow(), NULL));
ui::LocatedEvent* converted = tracker->ConvertEvent(target, event);
return converted;
@@ -54,11 +55,11 @@ TEST_F(DragDropTrackerTest, GetTarget) {
aura::Window::Windows root_windows = Shell::GetAllRootWindows();
EXPECT_EQ(2U, root_windows.size());
- scoped_ptr<aura::Window> window0(
+ std::unique_ptr<aura::Window> window0(
CreateTestWindow(gfx::Rect(0, 0, 100, 100)));
window0->Show();
- scoped_ptr<aura::Window> window1(
+ std::unique_ptr<aura::Window> window1(
CreateTestWindow(gfx::Rect(300, 100, 100, 100)));
window1->Show();
EXPECT_EQ(root_windows[0], window0->GetRootWindow());
@@ -117,11 +118,11 @@ TEST_F(DragDropTrackerTest, ConvertEvent) {
aura::Window::Windows root_windows = Shell::GetAllRootWindows();
EXPECT_EQ(2U, root_windows.size());
- scoped_ptr<aura::Window> window0(
+ std::unique_ptr<aura::Window> window0(
CreateTestWindow(gfx::Rect(0, 0, 100, 100)));
window0->Show();
- scoped_ptr<aura::Window> window1(
+ std::unique_ptr<aura::Window> window1(
CreateTestWindow(gfx::Rect(300, 100, 100, 100)));
window1->Show();
@@ -133,8 +134,8 @@ TEST_F(DragDropTrackerTest, ConvertEvent) {
ui::MouseEvent original00(ui::ET_MOUSE_DRAGGED, gfx::Point(50, 50),
gfx::Point(50, 50), ui::EventTimeForNow(),
ui::EF_NONE, ui::EF_NONE);
- scoped_ptr<ui::LocatedEvent> converted00(ConvertEvent(window0.get(),
- original00));
+ std::unique_ptr<ui::LocatedEvent> converted00(
+ ConvertEvent(window0.get(), original00));
EXPECT_EQ(original00.type(), converted00->type());
EXPECT_EQ("50,50", converted00->location().ToString());
EXPECT_EQ("50,50", converted00->root_location().ToString());
@@ -145,8 +146,8 @@ TEST_F(DragDropTrackerTest, ConvertEvent) {
ui::MouseEvent original01(ui::ET_MOUSE_DRAGGED, gfx::Point(350, 150),
gfx::Point(350, 150), ui::EventTimeForNow(),
ui::EF_NONE, ui::EF_NONE);
- scoped_ptr<ui::LocatedEvent> converted01(ConvertEvent(window1.get(),
- original01));
+ std::unique_ptr<ui::LocatedEvent> converted01(
+ ConvertEvent(window1.get(), original01));
EXPECT_EQ(original01.type(), converted01->type());
EXPECT_EQ("50,50", converted01->location().ToString());
EXPECT_EQ("150,150", converted01->root_location().ToString());
@@ -160,8 +161,8 @@ TEST_F(DragDropTrackerTest, ConvertEvent) {
ui::MouseEvent original10(ui::ET_MOUSE_DRAGGED, gfx::Point(-150, 50),
gfx::Point(-150, 50), ui::EventTimeForNow(),
ui::EF_NONE, ui::EF_NONE);
- scoped_ptr<ui::LocatedEvent> converted10(ConvertEvent(window0.get(),
- original10));
+ std::unique_ptr<ui::LocatedEvent> converted10(
+ ConvertEvent(window0.get(), original10));
EXPECT_EQ(original10.type(), converted10->type());
EXPECT_EQ("50,50", converted10->location().ToString());
EXPECT_EQ("50,50", converted10->root_location().ToString());
@@ -172,8 +173,8 @@ TEST_F(DragDropTrackerTest, ConvertEvent) {
ui::MouseEvent original11(ui::ET_MOUSE_DRAGGED, gfx::Point(150, 150),
gfx::Point(150, 150), ui::EventTimeForNow(),
ui::EF_NONE, ui::EF_NONE);
- scoped_ptr<ui::LocatedEvent> converted11(ConvertEvent(window1.get(),
- original11));
+ std::unique_ptr<ui::LocatedEvent> converted11(
+ ConvertEvent(window1.get(), original11));
EXPECT_EQ(original11.type(), converted11->type());
EXPECT_EQ("50,50", converted11->location().ToString());
EXPECT_EQ("150,150", converted11->root_location().ToString());
« no previous file with comments | « ash/drag_drop/drag_drop_tracker.h ('k') | ash/drag_drop/drag_image_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698