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

Side by Side Diff: ash/drag_drop/drag_drop_controller_unittest.cc

Issue 64933002: Eliminate Shell::RootWindowList in favor of aura::Window::Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 1 month 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 | Annotate | Revision Log
OLDNEW
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 "ash/drag_drop/drag_drop_controller.h" 5 #include "ash/drag_drop/drag_drop_controller.h"
6 6
7 #include "ash/drag_drop/drag_drop_tracker.h" 7 #include "ash/drag_drop/drag_drop_tracker.h"
8 #include "ash/drag_drop/drag_image_view.h" 8 #include "ash/drag_drop/drag_image_view.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/test/ash_test_base.h" 10 #include "ash/test/ash_test_base.h"
(...skipping 1002 matching lines...) Expand 10 before | Expand all | Expand 10 after
1013 1013
1014 } 1014 }
1015 1015
1016 // Verifies the drag image moves back to the position where drag is started 1016 // Verifies the drag image moves back to the position where drag is started
1017 // across displays when drag is cancelled. 1017 // across displays when drag is cancelled.
1018 TEST_F(DragDropControllerTest, DragCancelAcrossDisplays) { 1018 TEST_F(DragDropControllerTest, DragCancelAcrossDisplays) {
1019 if (!SupportsMultipleDisplays()) 1019 if (!SupportsMultipleDisplays())
1020 return; 1020 return;
1021 1021
1022 UpdateDisplay("400x400,400x400"); 1022 UpdateDisplay("400x400,400x400");
1023 Shell::RootWindowList root_windows = 1023 aura::Window::Windows root_windows =
1024 Shell::GetInstance()->GetAllRootWindows(); 1024 Shell::GetInstance()->GetAllRootWindows();
1025 for (Shell::RootWindowList::iterator iter = root_windows.begin(); 1025 for (aura::Window::Windows::iterator iter = root_windows.begin();
1026 iter != root_windows.end(); ++iter) { 1026 iter != root_windows.end(); ++iter) {
1027 aura::client::SetDragDropClient(*iter, drag_drop_controller_.get()); 1027 aura::client::SetDragDropClient(*iter, drag_drop_controller_.get());
1028 } 1028 }
1029 1029
1030 ui::OSExchangeData data; 1030 ui::OSExchangeData data;
1031 data.SetString(UTF8ToUTF16("I am being dragged")); 1031 data.SetString(UTF8ToUTF16("I am being dragged"));
1032 { 1032 {
1033 scoped_ptr<views::Widget> widget(CreateNewWidget()); 1033 scoped_ptr<views::Widget> widget(CreateNewWidget());
1034 aura::Window* window = widget->GetNativeWindow(); 1034 aura::Window* window = widget->GetNativeWindow();
1035 drag_drop_controller_->StartDragAndDrop( 1035 drag_drop_controller_->StartDragAndDrop(
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
1092 gfx::Point(200, 0), 1092 gfx::Point(200, 0),
1093 ui::EF_NONE); 1093 ui::EF_NONE);
1094 drag_drop_controller_->DragUpdate(window, e); 1094 drag_drop_controller_->DragUpdate(window, e);
1095 } 1095 }
1096 1096
1097 drag_drop_controller_->DragCancel(); 1097 drag_drop_controller_->DragCancel();
1098 CompleteCancelAnimation(); 1098 CompleteCancelAnimation();
1099 1099
1100 EXPECT_EQ("405,405", observer.window_location_on_destroying().ToString()); 1100 EXPECT_EQ("405,405", observer.window_location_on_destroying().ToString());
1101 } 1101 }
1102 for (Shell::RootWindowList::iterator iter = root_windows.begin(); 1102 for (aura::Window::Windows::iterator iter = root_windows.begin();
1103 iter != root_windows.end(); ++iter) { 1103 iter != root_windows.end(); ++iter) {
1104 aura::client::SetDragDropClient(*iter, NULL); 1104 aura::client::SetDragDropClient(*iter, NULL);
1105 } 1105 }
1106 } 1106 }
1107 1107
1108 } // namespace test 1108 } // namespace test
1109 } // namespace aura 1109 } // namespace aura
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698