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/wm/workspace/workspace_manager.h" | 5 #include "ash/wm/workspace/workspace_manager.h" |
6 | 6 |
7 #include "ash/screen_ash.h" | 7 #include "ash/screen_ash.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "ash/shell_window_ids.h" | 9 #include "ash/shell_window_ids.h" |
10 #include "ash/test/ash_test_base.h" | 10 #include "ash/test/ash_test_base.h" |
(...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
665 scoped_ptr<Window> w2(CreateTestWindow()); | 665 scoped_ptr<Window> w2(CreateTestWindow()); |
666 | 666 |
667 w1->Show(); | 667 w1->Show(); |
668 w1->SetProperty(aura::client::kAnimationsDisabledKey, true); | 668 w1->SetProperty(aura::client::kAnimationsDisabledKey, true); |
669 | 669 |
670 w2->Show(); | 670 w2->Show(); |
671 w2->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); | 671 w2->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); |
672 EXPECT_TRUE(w1->GetProperty(aura::client::kAnimationsDisabledKey)); | 672 EXPECT_TRUE(w1->GetProperty(aura::client::kAnimationsDisabledKey)); |
673 } | 673 } |
674 | 674 |
| 675 // Verifies a window marked as persisting across all workspaces ends up in its |
| 676 // own workspace when maximized. |
| 677 TEST_F(WorkspaceManagerTest, MaximizeDontPersistEndsUpInOwnWorkspace) { |
| 678 scoped_ptr<Window> w1(CreateTestWindow()); |
| 679 |
| 680 SetPersistsAcrossAllWorkspaces( |
| 681 w1.get(), |
| 682 WINDOW_PERSISTS_ACROSS_ALL_WORKSPACES_VALUE_YES); |
| 683 w1->Show(); |
| 684 |
| 685 // Shouldn't contain the window initially. |
| 686 EXPECT_FALSE(manager_->Contains(w1.get())); |
| 687 |
| 688 // Maximize should trigger containing the window. |
| 689 w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); |
| 690 EXPECT_TRUE(manager_->Contains(w1.get())); |
| 691 |
| 692 // And resetting to normal should remove it. |
| 693 w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL); |
| 694 EXPECT_FALSE(manager_->Contains(w1.get())); |
| 695 } |
| 696 |
675 } // namespace internal | 697 } // namespace internal |
676 } // namespace ash | 698 } // namespace ash |
OLD | NEW |