| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/shelf/shelf_window_watcher.h" | 5 #include "ash/shelf/shelf_window_watcher.h" |
| 6 | 6 |
| 7 #include "ash/aura/wm_window_aura.h" | 7 #include "ash/aura/wm_window_aura.h" |
| 8 #include "ash/common/ash_switches.h" | 8 #include "ash/common/ash_switches.h" |
| 9 #include "ash/common/shelf/shelf_item_types.h" | 9 #include "ash/common/shelf/shelf_item_types.h" |
| 10 #include "ash/common/shelf/shelf_model.h" | 10 #include "ash/common/shelf/shelf_model.h" |
| 11 #include "ash/common/shell_window_ids.h" | 11 #include "ash/common/shell_window_ids.h" |
| 12 #include "ash/common/wm/window_resizer.h" | 12 #include "ash/common/wm/window_resizer.h" |
| 13 #include "ash/common/wm/window_state.h" | 13 #include "ash/common/wm/window_state.h" |
| 14 #include "ash/common/wm_shell.h" |
| 14 #include "ash/shelf/shelf_util.h" | 15 #include "ash/shelf/shelf_util.h" |
| 15 #include "ash/shell.h" | 16 #include "ash/shell.h" |
| 16 #include "ash/test/ash_test_base.h" | 17 #include "ash/test/ash_test_base.h" |
| 17 #include "ash/test/shell_test_api.h" | |
| 18 #include "ash/wm/window_state_aura.h" | 18 #include "ash/wm/window_state_aura.h" |
| 19 #include "ash/wm/window_util.h" | 19 #include "ash/wm/window_util.h" |
| 20 #include "base/command_line.h" | 20 #include "base/command_line.h" |
| 21 #include "ui/aura/client/aura_constants.h" | 21 #include "ui/aura/client/aura_constants.h" |
| 22 #include "ui/aura/window.h" | 22 #include "ui/aura/window.h" |
| 23 #include "ui/base/hit_test.h" | 23 #include "ui/base/hit_test.h" |
| 24 | 24 |
| 25 namespace ash { | 25 namespace ash { |
| 26 | 26 |
| 27 class ShelfWindowWatcherTest : public test::AshTestBase { | 27 class ShelfWindowWatcherTest : public test::AshTestBase { |
| 28 public: | 28 public: |
| 29 ShelfWindowWatcherTest() : model_(NULL) {} | 29 ShelfWindowWatcherTest() : model_(NULL) {} |
| 30 ~ShelfWindowWatcherTest() override {} | 30 ~ShelfWindowWatcherTest() override {} |
| 31 | 31 |
| 32 void SetUp() override { | 32 void SetUp() override { |
| 33 test::AshTestBase::SetUp(); | 33 test::AshTestBase::SetUp(); |
| 34 model_ = test::ShellTestApi(Shell::GetInstance()).shelf_model(); | 34 model_ = WmShell::Get()->shelf_model(); |
| 35 } | 35 } |
| 36 | 36 |
| 37 void TearDown() override { | 37 void TearDown() override { |
| 38 model_ = NULL; | 38 model_ = NULL; |
| 39 test::AshTestBase::TearDown(); | 39 test::AshTestBase::TearDown(); |
| 40 } | 40 } |
| 41 | 41 |
| 42 ShelfID CreateShelfItem(aura::Window* window) { | 42 ShelfID CreateShelfItem(aura::Window* window) { |
| 43 ShelfID id = model_->next_id(); | 43 ShelfID id = model_->next_id(); |
| 44 ShelfItemDetails item_details; | 44 ShelfItemDetails item_details; |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 // container before fininshing the dragging. | 272 // container before fininshing the dragging. |
| 273 EXPECT_TRUE(wm::GetWindowState(window.get())->is_dragged()); | 273 EXPECT_TRUE(wm::GetWindowState(window.get())->is_dragged()); |
| 274 new_parent->AddChild(window.get()); | 274 new_parent->AddChild(window.get()); |
| 275 EXPECT_EQ(1, model_->item_count()); | 275 EXPECT_EQ(1, model_->item_count()); |
| 276 } | 276 } |
| 277 EXPECT_FALSE(wm::GetWindowState(window.get())->is_dragged()); | 277 EXPECT_FALSE(wm::GetWindowState(window.get())->is_dragged()); |
| 278 EXPECT_EQ(1, model_->item_count()); | 278 EXPECT_EQ(1, model_->item_count()); |
| 279 } | 279 } |
| 280 | 280 |
| 281 } // namespace ash | 281 } // namespace ash |
| OLD | NEW |