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.h" | 5 #include "chrome/browser/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" |
11 #include "base/bind_helpers.h" | 11 #include "base/bind_helpers.h" |
12 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
13 #include "chrome/browser/managed_mode.h" | 13 #include "chrome/browser/managed_mode.h" |
14 #include "chrome/browser/ui/browser.h" | 14 #include "chrome/browser/ui/browser.h" |
15 #include "chrome/test/base/test_browser_window.h" | 15 #include "chrome/test/base/test_browser_window.h" |
16 #include "chrome/test/base/testing_profile.h" | 16 #include "chrome/test/base/testing_profile.h" |
17 #include "content/test/test_browser_thread.h" | 17 #include "content/public/test/test_browser_thread.h" |
18 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
19 #include "testing/gmock/include/gmock/gmock.h" | 19 #include "testing/gmock/include/gmock/gmock.h" |
20 | 20 |
21 using ::testing::StrictMock; | 21 using ::testing::StrictMock; |
22 | 22 |
23 namespace { | 23 namespace { |
24 | 24 |
25 class FakeManagedMode : public ManagedMode { | 25 class FakeManagedMode : public ManagedMode { |
26 public: | 26 public: |
27 FakeManagedMode() : in_managed_mode_(false), should_cancel_enter_(false) { | 27 FakeManagedMode() : in_managed_mode_(false), should_cancel_enter_(false) { |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 | 221 |
222 TEST_F(ManagedModeTest, Cancelled) { | 222 TEST_F(ManagedModeTest, Cancelled) { |
223 BrowserFixture managed_mode_browser(&managed_mode_, &managed_mode_profile_); | 223 BrowserFixture managed_mode_browser(&managed_mode_, &managed_mode_profile_); |
224 BrowserFixture other_browser(&managed_mode_, &other_profile_); | 224 BrowserFixture other_browser(&managed_mode_, &other_profile_); |
225 | 225 |
226 // If the user cancelled entering managed mode, it should fail immediately. | 226 // If the user cancelled entering managed mode, it should fail immediately. |
227 managed_mode_.set_should_cancel_enter(true); | 227 managed_mode_.set_should_cancel_enter(true); |
228 managed_mode_.EnterManagedModeForTesting(&managed_mode_profile_, | 228 managed_mode_.EnterManagedModeForTesting(&managed_mode_profile_, |
229 CreateExpectedCallback(false)); | 229 CreateExpectedCallback(false)); |
230 } | 230 } |
OLD | NEW |