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

Side by Side Diff: ash/focus_cycler_unittest.cc

Issue 14297013: Cleanup: Remove unnecessary ".get()" from scoped_ptrs<>. (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
« no previous file with comments | « ash/drag_drop/drag_drop_controller.cc ('k') | ash/launcher/launcher_view.cc » ('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/focus_cycler.h" 5 #include "ash/focus_cycler.h"
6 6
7 #include "ash/launcher/launcher.h" 7 #include "ash/launcher/launcher.h"
8 #include "ash/root_window_controller.h" 8 #include "ash/root_window_controller.h"
9 #include "ash/shelf/shelf_widget.h" 9 #include "ash/shelf/shelf_widget.h"
10 #include "ash/shell.h" 10 #include "ash/shell.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 virtual void SetUp() OVERRIDE { 43 virtual void SetUp() OVERRIDE {
44 AshTestBase::SetUp(); 44 AshTestBase::SetUp();
45 45
46 focus_cycler_.reset(new FocusCycler()); 46 focus_cycler_.reset(new FocusCycler());
47 47
48 ASSERT_TRUE(Launcher::ForPrimaryDisplay()); 48 ASSERT_TRUE(Launcher::ForPrimaryDisplay());
49 } 49 }
50 50
51 virtual void TearDown() OVERRIDE { 51 virtual void TearDown() OVERRIDE {
52 if (tray_.get()) { 52 if (tray_) {
53 GetStatusAreaWidgetDelegate(tray_->GetWidget())-> 53 GetStatusAreaWidgetDelegate(tray_->GetWidget())->
54 SetFocusCyclerForTesting(NULL); 54 SetFocusCyclerForTesting(NULL);
55 tray_.reset(); 55 tray_.reset();
56 } 56 }
57 57
58 shelf_widget()->SetFocusCycler(NULL); 58 shelf_widget()->SetFocusCycler(NULL);
59 59
60 focus_cycler_.reset(); 60 focus_cycler_.reset();
61 61
62 AshTestBase::TearDown(); 62 AshTestBase::TearDown();
63 } 63 }
64 64
65 protected: 65 protected:
66 // Creates the system tray, returning true on success. 66 // Creates the system tray, returning true on success.
67 bool CreateTray() { 67 bool CreateTray() {
68 if (tray_.get()) 68 if (tray_)
69 return false; 69 return false;
70 aura::Window* parent = Shell::GetPrimaryRootWindowController()-> 70 aura::Window* parent = Shell::GetPrimaryRootWindowController()->
71 GetContainer(ash::internal::kShellWindowId_StatusContainer); 71 GetContainer(ash::internal::kShellWindowId_StatusContainer);
72 72
73 internal::StatusAreaWidget* widget = new internal::StatusAreaWidget(parent); 73 internal::StatusAreaWidget* widget = new internal::StatusAreaWidget(parent);
74 widget->CreateTrayViews(); 74 widget->CreateTrayViews();
75 widget->Show(); 75 widget->Show();
76 tray_.reset(widget->system_tray()); 76 tray_.reset(widget->system_tray());
77 if (!tray_->GetWidget()) 77 if (!tray_->GetWidget())
78 return false; 78 return false;
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 focus_cycler()->RotateFocus(FocusCycler::BACKWARD); 256 focus_cycler()->RotateFocus(FocusCycler::BACKWARD);
257 EXPECT_TRUE(tray()->GetWidget()->IsActive()); 257 EXPECT_TRUE(tray()->GetWidget()->IsActive());
258 258
259 // Cycle focus to the browser. 259 // Cycle focus to the browser.
260 focus_cycler()->RotateFocus(FocusCycler::BACKWARD); 260 focus_cycler()->RotateFocus(FocusCycler::BACKWARD);
261 EXPECT_TRUE(wm::IsActiveWindow(window0.get())); 261 EXPECT_TRUE(wm::IsActiveWindow(window0.get()));
262 } 262 }
263 263
264 } // namespace test 264 } // namespace test
265 } // namespace ash 265 } // namespace ash
OLDNEW
« no previous file with comments | « ash/drag_drop/drag_drop_controller.cc ('k') | ash/launcher/launcher_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698