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/display/display_controller.h" | 5 #include "ash/display/display_controller.h" |
6 | 6 |
7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
8 #include "ash/display/display_info.h" | 8 #include "ash/display/display_info.h" |
9 #include "ash/display/display_layout_store.h" | 9 #include "ash/display/display_layout_store.h" |
10 #include "ash/display/display_manager.h" | 10 #include "ash/display/display_manager.h" |
11 #include "ash/screen_util.h" | 11 #include "ash/screen_util.h" |
12 #include "ash/shelf/shelf.h" | 12 #include "ash/shelf/shelf.h" |
13 #include "ash/shelf/shelf_widget.h" | 13 #include "ash/shelf/shelf_widget.h" |
14 #include "ash/shell.h" | 14 #include "ash/shell.h" |
15 #include "ash/test/ash_test_base.h" | 15 #include "ash/test/ash_test_base.h" |
16 #include "ash/test/ash_test_helper.h" | 16 #include "ash/test/ash_test_helper.h" |
17 #include "ash/test/cursor_manager_test_api.h" | 17 #include "ash/test/cursor_manager_test_api.h" |
18 #include "ash/test/display_manager_test_api.h" | 18 #include "ash/test/display_manager_test_api.h" |
19 #include "ash/test/test_shell_delegate.h" | 19 #include "ash/test/test_shell_delegate.h" |
20 #include "ash/wm/window_state.h" | 20 #include "ash/wm/window_state.h" |
21 #include "ash/wm/wm_event.h" | 21 #include "ash/wm/wm_event.h" |
22 #include "base/command_line.h" | 22 #include "base/command_line.h" |
23 #include "ui/aura/client/focus_change_observer.h" | 23 #include "ui/aura/client/focus_change_observer.h" |
24 #include "ui/aura/client/focus_client.h" | 24 #include "ui/aura/client/focus_client.h" |
25 #include "ui/aura/env.h" | 25 #include "ui/aura/env.h" |
26 #include "ui/aura/test/test_window_delegate.h" | |
26 #include "ui/aura/window_tracker.h" | 27 #include "ui/aura/window_tracker.h" |
27 #include "ui/aura/window_tree_host.h" | 28 #include "ui/aura/window_tree_host.h" |
28 #include "ui/events/event_handler.h" | 29 #include "ui/events/event_handler.h" |
29 #include "ui/events/test/event_generator.h" | 30 #include "ui/events/test/event_generator.h" |
30 #include "ui/gfx/display.h" | 31 #include "ui/gfx/display.h" |
31 #include "ui/gfx/screen.h" | 32 #include "ui/gfx/screen.h" |
32 #include "ui/views/widget/widget.h" | 33 #include "ui/views/widget/widget.h" |
33 #include "ui/wm/public/activation_change_observer.h" | 34 #include "ui/wm/public/activation_change_observer.h" |
34 #include "ui/wm/public/activation_client.h" | 35 #include "ui/wm/public/activation_client.h" |
35 | 36 |
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
547 return info; | 548 return info; |
548 } | 549 } |
549 | 550 |
550 } // namespace | 551 } // namespace |
551 | 552 |
552 TEST_F(DisplayControllerTest, MirrorToDockedWithFullscreen) { | 553 TEST_F(DisplayControllerTest, MirrorToDockedWithFullscreen) { |
553 if (!SupportsMultipleDisplays()) | 554 if (!SupportsMultipleDisplays()) |
554 return; | 555 return; |
555 | 556 |
556 // Creates windows to catch activation change event. | 557 // Creates windows to catch activation change event. |
557 scoped_ptr<aura::Window> w1(CreateTestWindowInShellWithId(1)); | 558 scoped_ptr<aura::Window> w1(CreateTestWindowInShellWithDelegate( |
559 aura::test::TestWindowDelegate::CreateSelfDestroyingDelegate(), | |
560 1, | |
561 gfx::Rect())); | |
oshima
2014/09/11 17:25:49
what kind of error you had?
jackhou1
2014/09/11 18:02:18
Basically they'd fail because CanMaximize is false
| |
558 w1->Focus(); | 562 w1->Focus(); |
559 | 563 |
560 // Docked mode. | 564 // Docked mode. |
561 DisplayManager* display_manager = Shell::GetInstance()->display_manager(); | 565 DisplayManager* display_manager = Shell::GetInstance()->display_manager(); |
562 | 566 |
563 const DisplayInfo internal_display_info = | 567 const DisplayInfo internal_display_info = |
564 CreateDisplayInfo(1, gfx::Rect(0, 0, 500, 500), 2.0f); | 568 CreateDisplayInfo(1, gfx::Rect(0, 0, 500, 500), 2.0f); |
565 const DisplayInfo external_display_info = | 569 const DisplayInfo external_display_info = |
566 CreateDisplayInfo(2, gfx::Rect(0, 0, 500, 500), 1.0f); | 570 CreateDisplayInfo(2, gfx::Rect(0, 0, 500, 500), 1.0f); |
567 | 571 |
(...skipping 766 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1334 EXPECT_EQ("aura_root_x", GetXWindowName(secondary->GetHost())); | 1338 EXPECT_EQ("aura_root_x", GetXWindowName(secondary->GetHost())); |
1335 | 1339 |
1336 // Switching back to single display. | 1340 // Switching back to single display. |
1337 UpdateDisplay("300x400"); | 1341 UpdateDisplay("300x400"); |
1338 EXPECT_EQ("aura_root_0", GetXWindowName( | 1342 EXPECT_EQ("aura_root_0", GetXWindowName( |
1339 Shell::GetPrimaryRootWindow()->GetHost())); | 1343 Shell::GetPrimaryRootWindow()->GetHost())); |
1340 } | 1344 } |
1341 #endif | 1345 #endif |
1342 | 1346 |
1343 } // namespace ash | 1347 } // namespace ash |
OLD | NEW |