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

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

Issue 9557005: Makes sure switching workspaces only animations windows that want to (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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
« no previous file with comments | « ash/wm/workspace/workspace_manager.cc ('k') | ui/aura/window.h » ('j') | 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 "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/shell_window_ids.h" 8 #include "ash/shell_window_ids.h"
9 #include "ash/test/ash_test_base.h" 9 #include "ash/test/ash_test_base.h"
10 #include "ash/wm/activation_controller.h" 10 #include "ash/wm/activation_controller.h"
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 ASSERT_EQ(1u, workspaces().size()); 389 ASSERT_EQ(1u, workspaces().size());
390 EXPECT_EQ(Workspace::TYPE_MAXIMIZED, workspaces()[0]->type()); 390 EXPECT_EQ(Workspace::TYPE_MAXIMIZED, workspaces()[0]->type());
391 ASSERT_EQ(1u, workspaces()[0]->windows().size()); 391 ASSERT_EQ(1u, workspaces()[0]->windows().size());
392 EXPECT_EQ(w1.get(), workspaces()[0]->windows()[0]); 392 EXPECT_EQ(w1.get(), workspaces()[0]->windows()[0]);
393 EXPECT_EQ(GetFullscreenBounds(w1.get()).width(), w1->bounds().width()); 393 EXPECT_EQ(GetFullscreenBounds(w1.get()).width(), w1->bounds().width());
394 EXPECT_EQ(GetFullscreenBounds(w1.get()).height(), w1->bounds().height()); 394 EXPECT_EQ(GetFullscreenBounds(w1.get()).height(), w1->bounds().height());
395 ASSERT_TRUE(GetRestoreBounds(w1.get())); 395 ASSERT_TRUE(GetRestoreBounds(w1.get()));
396 EXPECT_EQ(gfx::Rect(0, 0, 250, 251), *GetRestoreBounds(w1.get())); 396 EXPECT_EQ(gfx::Rect(0, 0, 250, 251), *GetRestoreBounds(w1.get()));
397 } 397 }
398 398
399 // Makes sure switching workspaces doesn't show transient windows.
400 TEST_F(WorkspaceManagerTest, DontShowTransientsOnSwitch) {
401 scoped_ptr<Window> w1(CreateTestWindow());
402 scoped_ptr<Window> w2(CreateTestWindow());
403
404 w1->SetBounds(gfx::Rect(0, 0, 250, 251));
405 w2->SetBounds(gfx::Rect(0, 0, 250, 251));
406 w1->AddTransientChild(w2.get());
407
408 w1->Show();
409
410 scoped_ptr<Window> w3(CreateTestWindow());
411 w3->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED);
412 w3->Show();
413
414 EXPECT_FALSE(w1->layer()->IsDrawn());
415 EXPECT_FALSE(w2->layer()->IsDrawn());
416 EXPECT_TRUE(w3->layer()->IsDrawn());
417
418 w1->Show();
419 EXPECT_TRUE(w1->layer()->IsDrawn());
420 EXPECT_FALSE(w2->layer()->IsDrawn());
421 EXPECT_FALSE(w3->layer()->IsDrawn());
422 }
423
399 } // namespace internal 424 } // namespace internal
400 } // namespace ash 425 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/workspace/workspace_manager.cc ('k') | ui/aura/window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698