OLD | NEW |
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 "chrome/browser/managed_mode/managed_mode.h" | 5 #include "chrome/browser/managed_mode/managed_mode.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 | 66 |
67 class MockBrowserWindow : public TestBrowserWindow { | 67 class MockBrowserWindow : public TestBrowserWindow { |
68 public: | 68 public: |
69 MOCK_METHOD0(Close, void()); | 69 MOCK_METHOD0(Close, void()); |
70 }; | 70 }; |
71 | 71 |
72 class BrowserFixture { | 72 class BrowserFixture { |
73 public: | 73 public: |
74 BrowserFixture(FakeManagedMode* managed_mode, | 74 BrowserFixture(FakeManagedMode* managed_mode, |
75 TestingProfile* profile) { | 75 TestingProfile* profile) { |
76 Browser::CreateParams params(profile, chrome::HOST_DESKTOP_TYPE_NATIVE); | 76 Browser::CreateParams params(profile, chrome::GetActiveDesktop()); |
77 params.window = &window_; | 77 params.window = &window_; |
78 browser_.reset(new Browser(params)); | 78 browser_.reset(new Browser(params)); |
79 } | 79 } |
80 | 80 |
81 ~BrowserFixture() { | 81 ~BrowserFixture() { |
82 } | 82 } |
83 | 83 |
84 MockBrowserWindow* window() { | 84 MockBrowserWindow* window() { |
85 return &window_; | 85 return &window_; |
86 } | 86 } |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 | 226 |
227 TEST_F(ManagedModeTest, Cancelled) { | 227 TEST_F(ManagedModeTest, Cancelled) { |
228 BrowserFixture managed_mode_browser(&managed_mode_, &managed_mode_profile_); | 228 BrowserFixture managed_mode_browser(&managed_mode_, &managed_mode_profile_); |
229 BrowserFixture other_browser(&managed_mode_, &other_profile_); | 229 BrowserFixture other_browser(&managed_mode_, &other_profile_); |
230 | 230 |
231 // If the user cancelled entering managed mode, it should fail immediately. | 231 // If the user cancelled entering managed mode, it should fail immediately. |
232 managed_mode_.set_should_cancel_enter(true); | 232 managed_mode_.set_should_cancel_enter(true); |
233 managed_mode_.EnterManagedModeForTesting(&managed_mode_profile_, | 233 managed_mode_.EnterManagedModeForTesting(&managed_mode_profile_, |
234 CreateExpectedCallback(false)); | 234 CreateExpectedCallback(false)); |
235 } | 235 } |
OLD | NEW |