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

Side by Side Diff: ash/wm/workspace/workspace_manager_unittest.cc

Issue 13867010: ash: Fix transient child in wrong workspace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 months 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
« ash/wm/workspace/workspace.cc ('K') | « ash/wm/workspace/workspace.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/wm/workspace/workspace_manager.h" 5 #include "ash/wm/workspace/workspace_manager.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "ash/ash_switches.h" 9 #include "ash/ash_switches.h"
10 #include "ash/root_window_controller.h" 10 #include "ash/root_window_controller.h"
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 EXPECT_FALSE(w1->layer()->IsDrawn()); 445 EXPECT_FALSE(w1->layer()->IsDrawn());
446 EXPECT_FALSE(w2->layer()->IsDrawn()); 446 EXPECT_FALSE(w2->layer()->IsDrawn());
447 EXPECT_TRUE(w3->layer()->IsDrawn()); 447 EXPECT_TRUE(w3->layer()->IsDrawn());
448 448
449 wm::ActivateWindow(w1.get()); 449 wm::ActivateWindow(w1.get());
450 EXPECT_TRUE(w1->layer()->IsDrawn()); 450 EXPECT_TRUE(w1->layer()->IsDrawn());
451 EXPECT_FALSE(w2->layer()->IsDrawn()); 451 EXPECT_FALSE(w2->layer()->IsDrawn());
452 EXPECT_FALSE(w3->layer()->IsDrawn()); 452 EXPECT_FALSE(w3->layer()->IsDrawn());
453 } 453 }
454 454
455 // Persists-across-all-workspace flag should not cause a transient child
456 // to be activated at desktop workspace.
457 TEST_F(WorkspaceManagerTest, PersistsTransientChildStayInSameWorkspace) {
458 scoped_ptr<Window> w1(CreateTestWindow());
459 SetPersistsAcrossAllWorkspaces(
460 w1.get(),
461 WINDOW_PERSISTS_ACROSS_ALL_WORKSPACES_VALUE_YES);
462 w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED);
463 w1->Show();
464 wm::ActivateWindow(w1.get());
465 ASSERT_EQ("0 M1 active=1", StateString());
466
467 scoped_ptr<Window> w2(CreateTestWindowUnparented());
468 w1->AddTransientChild(w2.get());
469 SetPersistsAcrossAllWorkspaces(
470 w2.get(),
471 WINDOW_PERSISTS_ACROSS_ALL_WORKSPACES_VALUE_YES);
472 SetDefaultParentByPrimaryRootWindow(w2.get());
473 w2->Show();
474 wm::ActivateWindow(w2.get());
475
476 ASSERT_EQ("0 M2 active=1", StateString());
477 }
478
455 // Assertions around minimizing a single window. 479 // Assertions around minimizing a single window.
456 TEST_F(WorkspaceManagerTest, MinimizeSingleWindow) { 480 TEST_F(WorkspaceManagerTest, MinimizeSingleWindow) {
457 scoped_ptr<Window> w1(CreateTestWindow()); 481 scoped_ptr<Window> w1(CreateTestWindow());
458 482
459 w1->Show(); 483 w1->Show();
460 ASSERT_EQ("1 active=0", StateString()); 484 ASSERT_EQ("1 active=0", StateString());
461 485
462 w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MINIMIZED); 486 w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MINIMIZED);
463 ASSERT_EQ("1 active=0", StateString()); 487 ASSERT_EQ("1 active=0", StateString());
464 EXPECT_FALSE(w1->layer()->IsDrawn()); 488 EXPECT_FALSE(w1->layer()->IsDrawn());
(...skipping 1198 matching lines...) Expand 10 before | Expand all | Expand 10 after
1663 // Marking the window tracked again should snap back to origin. 1687 // Marking the window tracked again should snap back to origin.
1664 EXPECT_EQ("0 M1 active=1", StateString()); 1688 EXPECT_EQ("0 M1 active=1", StateString());
1665 EXPECT_EQ(max_bounds.ToString(), w1->bounds().ToString()); 1689 EXPECT_EQ(max_bounds.ToString(), w1->bounds().ToString());
1666 EXPECT_EQ(0, observer.change_count()); 1690 EXPECT_EQ(0, observer.change_count());
1667 1691
1668 w1->parent()->parent()->RemoveObserver(&observer); 1692 w1->parent()->parent()->RemoveObserver(&observer);
1669 } 1693 }
1670 1694
1671 } // namespace internal 1695 } // namespace internal
1672 } // namespace ash 1696 } // namespace ash
OLDNEW
« ash/wm/workspace/workspace.cc ('K') | « ash/wm/workspace/workspace.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698