| OLD | NEW |
| 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_tracker.h" | 5 #include "ash/drag_drop/drag_drop_tracker.h" |
| 6 | 6 |
| 7 #include "ash/root_window_controller.h" |
| 7 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 8 #include "ash/shell_window_ids.h" | 9 #include "ash/shell_window_ids.h" |
| 10 #include "ash/system/tray/system_tray.h" |
| 9 #include "ash/test/ash_test_base.h" | 11 #include "ash/test/ash_test_base.h" |
| 10 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 11 #include "ui/aura/root_window.h" | 13 #include "ui/aura/root_window.h" |
| 12 #include "ui/aura/test/test_windows.h" | 14 #include "ui/aura/test/test_windows.h" |
| 13 #include "ui/aura/window.h" | 15 #include "ui/aura/window.h" |
| 14 | 16 |
| 15 namespace ash { | 17 namespace ash { |
| 16 namespace test { | 18 namespace test { |
| 17 | 19 |
| 18 class DragDropTrackerTest : public test::AshTestBase { | 20 class DragDropTrackerTest : public test::AshTestBase { |
| 19 public: | 21 public: |
| 20 virtual void SetUp() OVERRIDE { | 22 virtual void SetUp() OVERRIDE { |
| 21 AshTestBase::SetUp(); | 23 AshTestBase::SetUp(); |
| 22 UpdateDisplay("200x200,200x200"); | 24 UpdateDisplay("200x200,200x200"); |
| 25 // close all notification for display change. Otherwise some event may |
| 26 // happen on the notification bubble, which breaks the test expectation. |
| 27 // TODO(mukai): remove this when the display change notification has moved |
| 28 // to the message_center. |
| 29 Shell::RootWindowControllerList root_controllers = |
| 30 Shell::GetAllRootWindowControllers(); |
| 31 for (size_t i = 0; i < root_controllers.size(); ++i) |
| 32 root_controllers[i]->GetSystemTray()->CloseNotificationBubbleForTest(); |
| 23 } | 33 } |
| 24 | 34 |
| 25 aura::Window* CreateTestWindow(const gfx::Rect& bounds) { | 35 aura::Window* CreateTestWindow(const gfx::Rect& bounds) { |
| 26 static int window_id = 0; | 36 static int window_id = 0; |
| 27 return CreateTestWindowInShellWithDelegate( | 37 return CreateTestWindowInShellWithDelegate( |
| 28 aura::test::TestWindowDelegate::CreateSelfDestroyingDelegate(), | 38 aura::test::TestWindowDelegate::CreateSelfDestroyingDelegate(), |
| 29 window_id++, | 39 window_id++, |
| 30 bounds); | 40 bounds); |
| 31 } | 41 } |
| 32 | 42 |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 scoped_ptr<ui::LocatedEvent> converted11(ConvertEvent(window1.get(), | 203 scoped_ptr<ui::LocatedEvent> converted11(ConvertEvent(window1.get(), |
| 194 original11)); | 204 original11)); |
| 195 EXPECT_EQ(original11.type(), converted11->type()); | 205 EXPECT_EQ(original11.type(), converted11->type()); |
| 196 EXPECT_EQ("50,50", converted11->location().ToString()); | 206 EXPECT_EQ("50,50", converted11->location().ToString()); |
| 197 EXPECT_EQ("150,150", converted11->root_location().ToString()); | 207 EXPECT_EQ("150,150", converted11->root_location().ToString()); |
| 198 EXPECT_EQ(original11.flags(), converted11->flags()); | 208 EXPECT_EQ(original11.flags(), converted11->flags()); |
| 199 } | 209 } |
| 200 | 210 |
| 201 } // namespace test | 211 } // namespace test |
| 202 } // namespace aura | 212 } // namespace aura |
| OLD | NEW |