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

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

Issue 9289036: aura: Add Layer::LAYER_SOLID_COLOR to compositor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: minor changes Created 8 years, 11 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
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_layout_manager.h" 5 #include "ash/wm/workspace/workspace_layout_manager.h"
6 6
7 #include "ash/wm/workspace/workspace.h" 7 #include "ash/wm/workspace/workspace.h"
8 #include "ash/wm/workspace/workspace_manager.h" 8 #include "ash/wm/workspace/workspace_manager.h"
9 #include "ash/wm/workspace_controller.h" 9 #include "ash/wm/workspace_controller.h"
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 container_->SetLayoutManager(layout_manager_); 43 container_->SetLayoutManager(layout_manager_);
44 44
45 root_window->SetHostSize(gfx::Size(500, 400)); 45 root_window->SetHostSize(gfx::Size(500, 400));
46 } 46 }
47 47
48 aura::Window* CreateTestWindowWithType(const gfx::Rect& bounds, 48 aura::Window* CreateTestWindowWithType(const gfx::Rect& bounds,
49 aura::Window* parent, 49 aura::Window* parent,
50 aura::client::WindowType type) { 50 aura::client::WindowType type) {
51 aura::Window* window = new aura::Window(NULL); 51 aura::Window* window = new aura::Window(NULL);
52 window->SetType(type); 52 window->SetType(type);
53 window->Init(ui::Layer::LAYER_HAS_NO_TEXTURE); 53 window->Init(ui::Layer::LAYER_NOT_DRAWN);
54 window->SetBounds(bounds); 54 window->SetBounds(bounds);
55 window->Show(); 55 window->Show();
56 window->SetParent(parent); 56 window->SetParent(parent);
57 return window; 57 return window;
58 } 58 }
59 59
60 aura::Window* CreateTestWindow(const gfx::Rect& bounds, 60 aura::Window* CreateTestWindow(const gfx::Rect& bounds,
61 aura::Window* parent) { 61 aura::Window* parent) {
62 return CreateTestWindowWithType(bounds, 62 return CreateTestWindowWithType(bounds,
63 parent, 63 parent,
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 // A popup window can be resized to the size bigger than draggable area. 159 // A popup window can be resized to the size bigger than draggable area.
160 popup->SetBounds(gfx::Rect(0, 0, 1000, 1000)); 160 popup->SetBounds(gfx::Rect(0, 0, 1000, 1000));
161 EXPECT_EQ("0,0 1000x1000", popup->bounds().ToString()); 161 EXPECT_EQ("0,0 1000x1000", popup->bounds().ToString());
162 } 162 }
163 163
164 // Make sure a window with a transient parent isn't resized by the layout 164 // Make sure a window with a transient parent isn't resized by the layout
165 // manager. 165 // manager.
166 TEST_F(WorkspaceLayoutManagerTest, IgnoreTransient) { 166 TEST_F(WorkspaceLayoutManagerTest, IgnoreTransient) {
167 scoped_ptr<aura::Window> window(new aura::Window(NULL)); 167 scoped_ptr<aura::Window> window(new aura::Window(NULL));
168 window->SetType(aura::client::WINDOW_TYPE_NORMAL); 168 window->SetType(aura::client::WINDOW_TYPE_NORMAL);
169 window->Init(ui::Layer::LAYER_HAS_NO_TEXTURE); 169 window->Init(ui::Layer::LAYER_NOT_DRAWN);
170 aura::RootWindow::GetInstance()->AddTransientChild(window.get()); 170 aura::RootWindow::GetInstance()->AddTransientChild(window.get());
171 window->SetBounds(gfx::Rect(0, 0, 200, 200)); 171 window->SetBounds(gfx::Rect(0, 0, 200, 200));
172 window->Show(); 172 window->Show();
173 window->SetParent(container()); 173 window->SetParent(container());
174 174
175 EXPECT_EQ("0,0 200x200", window->bounds().ToString()); 175 EXPECT_EQ("0,0 200x200", window->bounds().ToString());
176 } 176 }
177 177
178 TEST_F(WorkspaceLayoutManagerTest, Fullscreen) { 178 TEST_F(WorkspaceLayoutManagerTest, Fullscreen) {
179 scoped_ptr<aura::Window> w( 179 scoped_ptr<aura::Window> w(
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 332
333 Restore(w1.get()); 333 Restore(w1.get());
334 // The following test does not pass due to crbug.com/102413. 334 // The following test does not pass due to crbug.com/102413.
335 // TODO(oshima): Re-enable this once the bug is fixed. 335 // TODO(oshima): Re-enable this once the bug is fixed.
336 // EXPECT_EQ(window_bounds.size().ToString(), 336 // EXPECT_EQ(window_bounds.size().ToString(),
337 // w1->GetTargetBounds().size().ToString()); 337 // w1->GetTargetBounds().size().ToString());
338 } 338 }
339 339
340 } // namespace test 340 } // namespace test
341 } // namespace ash 341 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698