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

Unified Diff: ash/wm/panels/panel_window_resizer_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/wm/panels/panel_window_resizer.h ('k') | ash/wm/resize_shadow.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/panels/panel_window_resizer_unittest.cc
diff --git a/ash/wm/panels/panel_window_resizer_unittest.cc b/ash/wm/panels/panel_window_resizer_unittest.cc
index e14cd62523fb96810997dce6c79372c36522d94a..2df23df827ac5b03df3c4664f5bb020713087f18 100644
--- a/ash/wm/panels/panel_window_resizer_unittest.cc
+++ b/ash/wm/panels/panel_window_resizer_unittest.cc
@@ -143,8 +143,8 @@ class PanelWindowResizerTest : public test::AshTestBase {
// are reordered appropriately.
void DragAlongShelfReorder(int dx, int dy) {
gfx::Point origin(0, 0);
- scoped_ptr<aura::Window> w1(CreatePanelWindow(origin));
- scoped_ptr<aura::Window> w2(CreatePanelWindow(origin));
+ std::unique_ptr<aura::Window> w1(CreatePanelWindow(origin));
+ std::unique_ptr<aura::Window> w2(CreatePanelWindow(origin));
std::vector<aura::Window*> window_order_original;
std::vector<aura::Window*> window_order_swapped;
window_order_original.push_back(w1.get());
@@ -173,7 +173,7 @@ class PanelWindowResizerTest : public test::AshTestBase {
}
private:
- scoped_ptr<WindowResizer> resizer_;
+ std::unique_ptr<WindowResizer> resizer_;
ShelfModel* model_;
test::TestShelfDelegate* shelf_delegate_;
@@ -230,9 +230,8 @@ TEST_F(PanelWindowResizerTest, PanelDetachReattachBottom) {
if (!SupportsHostWindowResize())
return;
- scoped_ptr<aura::Window> window(
- CreatePanelWindow(gfx::Point(0, 0)));
- DetachReattachTest(window.get(), 0, -1);
+ std::unique_ptr<aura::Window> window(CreatePanelWindow(gfx::Point(0, 0)));
+ DetachReattachTest(window.get(), 0, -1);
}
TEST_F(PanelWindowResizerTest, PanelDetachReattachLeft) {
@@ -241,8 +240,7 @@ TEST_F(PanelWindowResizerTest, PanelDetachReattachLeft) {
ash::Shell* shell = ash::Shell::GetInstance();
shell->SetShelfAlignment(SHELF_ALIGNMENT_LEFT, shell->GetPrimaryRootWindow());
- scoped_ptr<aura::Window> window(
- CreatePanelWindow(gfx::Point(0, 0)));
+ std::unique_ptr<aura::Window> window(CreatePanelWindow(gfx::Point(0, 0)));
DetachReattachTest(window.get(), 1, 0);
}
@@ -253,8 +251,7 @@ TEST_F(PanelWindowResizerTest, PanelDetachReattachRight) {
ash::Shell* shell = ash::Shell::GetInstance();
shell->SetShelfAlignment(SHELF_ALIGNMENT_RIGHT,
shell->GetPrimaryRootWindow());
- scoped_ptr<aura::Window> window(
- CreatePanelWindow(gfx::Point(0, 0)));
+ std::unique_ptr<aura::Window> window(CreatePanelWindow(gfx::Point(0, 0)));
DetachReattachTest(window.get(), -1, 0);
}
@@ -263,8 +260,7 @@ TEST_F(PanelWindowResizerTest, PanelDetachReattachRight) {
TEST_F(PanelWindowResizerTest, DetachThenHideShelf) {
if (!SupportsHostWindowResize())
return;
- scoped_ptr<aura::Window> window(
- CreatePanelWindow(gfx::Point(0, 0)));
+ std::unique_ptr<aura::Window> window(CreatePanelWindow(gfx::Point(0, 0)));
wm::WindowState* state = wm::GetWindowState(window.get());
gfx::Rect expected_bounds = window->GetBoundsInScreen();
expected_bounds.set_y(expected_bounds.y() - 100);
@@ -296,8 +292,7 @@ TEST_F(PanelWindowResizerTest, PanelDetachReattachMultipleDisplays) {
UpdateDisplay("600x400,600x400");
aura::Window::Windows root_windows = Shell::GetAllRootWindows();
- scoped_ptr<aura::Window> window(
- CreatePanelWindow(gfx::Point(600, 0)));
+ std::unique_ptr<aura::Window> window(CreatePanelWindow(gfx::Point(600, 0)));
EXPECT_EQ(root_windows[1], window->GetRootWindow());
DetachReattachTest(window.get(), 0, -1);
}
@@ -308,8 +303,7 @@ TEST_F(PanelWindowResizerTest, DetachThenDragAcrossDisplays) {
UpdateDisplay("600x400,600x400");
aura::Window::Windows root_windows = Shell::GetAllRootWindows();
- scoped_ptr<aura::Window> window(
- CreatePanelWindow(gfx::Point(0, 0)));
+ std::unique_ptr<aura::Window> window(CreatePanelWindow(gfx::Point(0, 0)));
gfx::Rect initial_bounds = window->GetBoundsInScreen();
EXPECT_EQ(root_windows[0], window->GetRootWindow());
DragStart(window.get());
@@ -337,8 +331,7 @@ TEST_F(PanelWindowResizerTest, DetachAcrossDisplays) {
UpdateDisplay("600x400,600x400");
aura::Window::Windows root_windows = Shell::GetAllRootWindows();
- scoped_ptr<aura::Window> window(
- CreatePanelWindow(gfx::Point(0, 0)));
+ std::unique_ptr<aura::Window> window(CreatePanelWindow(gfx::Point(0, 0)));
gfx::Rect initial_bounds = window->GetBoundsInScreen();
EXPECT_EQ(root_windows[0], window->GetRootWindow());
DragStart(window.get());
@@ -357,8 +350,7 @@ TEST_F(PanelWindowResizerTest, DetachThenAttachToSecondDisplay) {
UpdateDisplay("600x400,600x600");
aura::Window::Windows root_windows = Shell::GetAllRootWindows();
- scoped_ptr<aura::Window> window(
- CreatePanelWindow(gfx::Point(0, 0)));
+ std::unique_ptr<aura::Window> window(CreatePanelWindow(gfx::Point(0, 0)));
gfx::Rect initial_bounds = window->GetBoundsInScreen();
EXPECT_EQ(root_windows[0], window->GetRootWindow());
@@ -390,8 +382,7 @@ TEST_F(PanelWindowResizerTest, AttachToSecondDisplay) {
UpdateDisplay("600x400,600x600");
aura::Window::Windows root_windows = Shell::GetAllRootWindows();
- scoped_ptr<aura::Window> window(
- CreatePanelWindow(gfx::Point(0, 0)));
+ std::unique_ptr<aura::Window> window(CreatePanelWindow(gfx::Point(0, 0)));
gfx::Rect initial_bounds = window->GetBoundsInScreen();
EXPECT_EQ(root_windows[0], window->GetRootWindow());
@@ -416,9 +407,8 @@ TEST_F(PanelWindowResizerTest, AttachToSecondFullscreenDisplay) {
UpdateDisplay("600x400,600x600");
aura::Window::Windows root_windows = Shell::GetAllRootWindows();
- scoped_ptr<aura::Window> window(
- CreatePanelWindow(gfx::Point(0, 0)));
- scoped_ptr<aura::Window> fullscreen(
+ std::unique_ptr<aura::Window> window(CreatePanelWindow(gfx::Point(0, 0)));
+ std::unique_ptr<aura::Window> fullscreen(
CreateTestWindowInShellWithBounds(gfx::Rect(600, 0, 101, 101)));
wm::GetWindowState(fullscreen.get())->Activate();
const wm::WMEvent event(wm::WM_EVENT_TOGGLE_FULLSCREEN);
@@ -447,8 +437,7 @@ TEST_F(PanelWindowResizerTest, AttachToSecondFullscreenDisplay) {
}
TEST_F(PanelWindowResizerTest, RevertDragRestoresAttachment) {
- scoped_ptr<aura::Window> window(
- CreatePanelWindow(gfx::Point(0, 0)));
+ std::unique_ptr<aura::Window> window(CreatePanelWindow(gfx::Point(0, 0)));
EXPECT_TRUE(wm::GetWindowState(window.get())->panel_attached());
EXPECT_EQ(kShellWindowId_PanelContainer, window->parent()->id());
DragStart(window.get());
@@ -475,7 +464,7 @@ TEST_F(PanelWindowResizerTest, RevertDragRestoresAttachment) {
}
TEST_F(PanelWindowResizerTest, DragMovesToPanelLayer) {
- scoped_ptr<aura::Window> window(CreatePanelWindow(gfx::Point(0, 0)));
+ std::unique_ptr<aura::Window> window(CreatePanelWindow(gfx::Point(0, 0)));
DragStart(window.get());
DragMove(0, -100);
DragEnd();
@@ -513,9 +502,10 @@ TEST_P(PanelWindowResizerTransientTest, PanelWithTransientChild) {
if (!SupportsHostWindowResize())
return;
- scoped_ptr<aura::Window> window(CreatePanelWindow(gfx::Point(0, 0)));
- scoped_ptr<aura::Window> child(CreateTestWindowInShellWithDelegateAndType(
- NULL, transient_window_type_, 0, gfx::Rect(20, 20, 150, 40)));
+ std::unique_ptr<aura::Window> window(CreatePanelWindow(gfx::Point(0, 0)));
+ std::unique_ptr<aura::Window> child(
+ CreateTestWindowInShellWithDelegateAndType(
+ NULL, transient_window_type_, 0, gfx::Rect(20, 20, 150, 40)));
::wm::AddTransientChild(window.get(), child.get());
if (window->parent() != child->parent())
window->parent()->AddChild(child.get());
« no previous file with comments | « ash/wm/panels/panel_window_resizer.h ('k') | ash/wm/resize_shadow.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698