OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <memory> | 5 #include <memory> |
6 #include <string> | 6 #include <string> |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
11 #include "base/values.h" | 11 #include "base/values.h" |
12 #include "chrome/browser/chrome_notification_types.h" | 12 #include "chrome/browser/chrome_notification_types.h" |
13 #include "chrome/browser/chromeos/login/ui/webui_login_display.h" | 13 #include "chrome/browser/chromeos/login/ui/webui_login_display.h" |
14 #include "chrome/browser/chromeos/policy/login_policy_test_base.h" | 14 #include "chrome/browser/chromeos/policy/login_policy_test_base.h" |
15 #include "chrome/browser/chromeos/policy/user_policy_test_helper.h" | 15 #include "chrome/browser/chromeos/policy/user_policy_test_helper.h" |
16 #include "chrome/browser/prefs/session_startup_pref.h" | 16 #include "chrome/browser/prefs/session_startup_pref.h" |
17 #include "chrome/browser/ui/browser.h" | 17 #include "chrome/browser/ui/browser.h" |
18 #include "chrome/browser/ui/browser_list.h" | 18 #include "chrome/browser/ui/browser_list.h" |
19 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 19 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 20 #include "components/policy/policy_constants.h" |
20 #include "components/user_manager/user.h" | 21 #include "components/user_manager/user.h" |
21 #include "components/user_manager/user_manager.h" | 22 #include "components/user_manager/user_manager.h" |
22 #include "content/public/browser/notification_observer.h" | 23 #include "content/public/browser/notification_observer.h" |
23 #include "content/public/browser/notification_registrar.h" | 24 #include "content/public/browser/notification_registrar.h" |
24 #include "content/public/browser/notification_service.h" | 25 #include "content/public/browser/notification_service.h" |
25 #include "policy/policy_constants.h" | |
26 #include "testing/gtest/include/gtest/gtest.h" | 26 #include "testing/gtest/include/gtest/gtest.h" |
27 | 27 |
28 namespace { | 28 namespace { |
29 // Helper class that counts the number of notifications of the specified | 29 // Helper class that counts the number of notifications of the specified |
30 // type that have been received. | 30 // type that have been received. |
31 class CountNotificationObserver : public content::NotificationObserver { | 31 class CountNotificationObserver : public content::NotificationObserver { |
32 public: | 32 public: |
33 CountNotificationObserver(int notification_type_to_count, | 33 CountNotificationObserver(int notification_type_to_count, |
34 const content::NotificationSource& source) | 34 const content::NotificationSource& source) |
35 : notification_count_(0) { | 35 : notification_count_(0) { |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 | 119 |
120 // User should not be marked as having a valid OAuth token. That way, if we | 120 // User should not be marked as having a valid OAuth token. That way, if we |
121 // try to load the user in the future, we will attempt to load policy again. | 121 // try to load the user in the future, we will attempt to load policy again. |
122 const user_manager::UserManager* user_manager = | 122 const user_manager::UserManager* user_manager = |
123 user_manager::UserManager::Get(); | 123 user_manager::UserManager::Get(); |
124 EXPECT_NE(user_manager::User::OAUTH2_TOKEN_STATUS_VALID, | 124 EXPECT_NE(user_manager::User::OAUTH2_TOKEN_STATUS_VALID, |
125 user_manager->GetActiveUser()->oauth_token_status()); | 125 user_manager->GetActiveUser()->oauth_token_status()); |
126 } | 126 } |
127 | 127 |
128 } // namespace policy | 128 } // namespace policy |
OLD | NEW |