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

Side by Side Diff: ash/shell_unittest.cc

Issue 11316323: Cleanup enums for shelf (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: style Created 8 years 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/shell/context_menu.cc ('k') | ash/system/status_area_widget.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/shell.h" 5 #include "ash/shell.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "ash/ash_switches.h" 10 #include "ash/ash_switches.h"
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 // Create a normal window. It is not maximized. 311 // Create a normal window. It is not maximized.
312 views::Widget::InitParams widget_params( 312 views::Widget::InitParams widget_params(
313 views::Widget::InitParams::TYPE_WINDOW); 313 views::Widget::InitParams::TYPE_WINDOW);
314 widget_params.bounds.SetRect(11, 22, 300, 400); 314 widget_params.bounds.SetRect(11, 22, 300, 400);
315 views::Widget* widget = CreateTestWindow(widget_params); 315 views::Widget* widget = CreateTestWindow(widget_params);
316 widget->Show(); 316 widget->Show();
317 EXPECT_FALSE(widget->IsMaximized()); 317 EXPECT_FALSE(widget->IsMaximized());
318 318
319 // Shelf defaults to visible. 319 // Shelf defaults to visible.
320 EXPECT_EQ( 320 EXPECT_EQ(
321 internal::ShelfLayoutManager::VISIBLE, 321 SHELF_VISIBLE,
322 Shell::GetPrimaryRootWindowController()->shelf()->visibility_state()); 322 Shell::GetPrimaryRootWindowController()->shelf()->visibility_state());
323 323
324 // Fullscreen window hides it. 324 // Fullscreen window hides it.
325 widget->SetFullscreen(true); 325 widget->SetFullscreen(true);
326 EXPECT_EQ( 326 EXPECT_EQ(
327 internal::ShelfLayoutManager::HIDDEN, 327 SHELF_HIDDEN,
328 Shell::GetPrimaryRootWindowController()->shelf()->visibility_state()); 328 Shell::GetPrimaryRootWindowController()->shelf()->visibility_state());
329 329
330 // Restoring the window restores it. 330 // Restoring the window restores it.
331 widget->Restore(); 331 widget->Restore();
332 EXPECT_EQ( 332 EXPECT_EQ(
333 internal::ShelfLayoutManager::VISIBLE, 333 SHELF_VISIBLE,
334 Shell::GetPrimaryRootWindowController()->shelf()->visibility_state()); 334 Shell::GetPrimaryRootWindowController()->shelf()->visibility_state());
335 335
336 // Clean up. 336 // Clean up.
337 widget->Close(); 337 widget->Close();
338 } 338 }
339 339
340 namespace { 340 namespace {
341 341
342 // Builds the list of parents from |window| to the root. The returned vector is 342 // Builds the list of parents from |window| to the root. The returned vector is
343 // in reverse order (|window| is first). 343 // in reverse order (|window| is first).
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 private: 405 private:
406 DISALLOW_COPY_AND_ASSIGN(ShellTest2); 406 DISALLOW_COPY_AND_ASSIGN(ShellTest2);
407 }; 407 };
408 408
409 TEST_F(ShellTest2, DontCrashWhenWindowDeleted) { 409 TEST_F(ShellTest2, DontCrashWhenWindowDeleted) {
410 window_.reset(new aura::Window(NULL)); 410 window_.reset(new aura::Window(NULL));
411 window_->Init(ui::LAYER_NOT_DRAWN); 411 window_->Init(ui::LAYER_NOT_DRAWN);
412 } 412 }
413 413
414 } // namespace ash 414 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shell/context_menu.cc ('k') | ash/system/status_area_widget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698