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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "base/threading/sequenced_worker_pool.h" | 10 #include "base/threading/sequenced_worker_pool.h" |
11 #include "chrome/browser/chrome_notification_types.h" | 11 #include "chrome/browser/chrome_notification_types.h" |
12 #include "chrome/browser/chromeos/login/login_manager_test.h" | 12 #include "chrome/browser/chromeos/login/login_manager_test.h" |
13 #include "chrome/browser/chromeos/login/managed/managed_user_test_base.h" | 13 #include "chrome/browser/chromeos/login/managed/managed_user_test_base.h" |
14 #include "chrome/browser/chromeos/login/managed/supervised_user_authentication.h
" | 14 #include "chrome/browser/chromeos/login/managed/supervised_user_authentication.h
" |
15 #include "chrome/browser/chromeos/login/startup_utils.h" | 15 #include "chrome/browser/chromeos/login/startup_utils.h" |
16 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h" | 16 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h" |
17 #include "chrome/browser/chromeos/login/ui/webui_login_view.h" | 17 #include "chrome/browser/chromeos/login/ui/webui_login_view.h" |
18 #include "chrome/browser/chromeos/login/users/supervised_user_manager.h" | 18 #include "chrome/browser/chromeos/login/users/supervised_user_manager.h" |
19 #include "chrome/browser/chromeos/net/network_portal_detector_test_impl.h" | 19 #include "chrome/browser/chromeos/net/network_portal_detector_test_impl.h" |
20 #include "chrome/browser/chromeos/settings/stub_cros_settings_provider.h" | 20 #include "chrome/browser/chromeos/settings/stub_cros_settings_provider.h" |
21 #include "chrome/browser/managed_mode/managed_user_constants.h" | 21 #include "chrome/browser/supervised_user/supervised_user_constants.h" |
22 #include "chrome/browser/managed_mode/managed_user_registration_utility.h" | 22 #include "chrome/browser/supervised_user/supervised_user_registration_utility.h" |
23 #include "chrome/browser/managed_mode/managed_user_registration_utility_stub.h" | 23 #include "chrome/browser/supervised_user/supervised_user_registration_utility_st
ub.h" |
24 #include "chrome/browser/managed_mode/managed_user_shared_settings_service.h" | 24 #include "chrome/browser/supervised_user/supervised_user_shared_settings_service
.h" |
25 #include "chrome/browser/managed_mode/managed_user_shared_settings_service_facto
ry.h" | 25 #include "chrome/browser/supervised_user/supervised_user_shared_settings_service
_factory.h" |
26 #include "chrome/browser/managed_mode/managed_user_sync_service.h" | 26 #include "chrome/browser/supervised_user/supervised_user_sync_service.h" |
27 #include "chrome/browser/managed_mode/managed_user_sync_service_factory.h" | 27 #include "chrome/browser/supervised_user/supervised_user_sync_service_factory.h" |
28 #include "chromeos/cryptohome/mock_async_method_caller.h" | 28 #include "chromeos/cryptohome/mock_async_method_caller.h" |
29 #include "chromeos/cryptohome/mock_homedir_methods.h" | 29 #include "chromeos/cryptohome/mock_homedir_methods.h" |
30 #include "content/public/browser/notification_service.h" | 30 #include "content/public/browser/notification_service.h" |
31 #include "content/public/test/browser_test_utils.h" | 31 #include "content/public/test/browser_test_utils.h" |
32 #include "content/public/test/test_utils.h" | 32 #include "content/public/test/test_utils.h" |
33 #include "sync/api/attachments/attachment_service_proxy_for_test.h" | 33 #include "sync/api/attachments/attachment_service_proxy_for_test.h" |
34 #include "sync/api/fake_sync_change_processor.h" | 34 #include "sync/api/fake_sync_change_processor.h" |
35 #include "sync/api/sync_change.h" | 35 #include "sync/api/sync_change.h" |
36 #include "sync/api/sync_error_factory_mock.h" | 36 #include "sync/api/sync_error_factory_mock.h" |
37 #include "sync/protocol/sync.pb.h" | 37 #include "sync/protocol/sync.pb.h" |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 EXPECT_CALL(*mock_homedir_methods_, AddKeyEx(_, _, _, _, _)).Times(1); | 149 EXPECT_CALL(*mock_homedir_methods_, AddKeyEx(_, _, _, _, _)).Times(1); |
150 | 150 |
151 JSEval("$('managed-user-creation-next-button').click()"); | 151 JSEval("$('managed-user-creation-next-button').click()"); |
152 | 152 |
153 testing::Mock::VerifyAndClearExpectations(mock_homedir_methods_); | 153 testing::Mock::VerifyAndClearExpectations(mock_homedir_methods_); |
154 | 154 |
155 EXPECT_TRUE(registration_utility_stub_->register_was_called()); | 155 EXPECT_TRUE(registration_utility_stub_->register_was_called()); |
156 EXPECT_EQ(registration_utility_stub_->display_name(), | 156 EXPECT_EQ(registration_utility_stub_->display_name(), |
157 base::UTF8ToUTF16(kTestSupervisedUserDisplayName)); | 157 base::UTF8ToUTF16(kTestSupervisedUserDisplayName)); |
158 | 158 |
159 std::string user_id = registration_utility_stub_->managed_user_id(); | 159 std::string user_id = registration_utility_stub_->supervised_user_id(); |
160 | 160 |
161 // Make sure user is already in list. | 161 // Make sure user is already in list. |
162 ASSERT_EQ(3UL, UserManager::Get()->GetUsers().size()); | 162 ASSERT_EQ(3UL, UserManager::Get()->GetUsers().size()); |
163 | 163 |
164 // We wait for token now. Press cancel button at this point. | 164 // We wait for token now. Press cancel button at this point. |
165 JSEval("$('cancel-add-user-button').click()"); | 165 JSEval("$('cancel-add-user-button').click()"); |
166 } | 166 } |
167 | 167 |
168 IN_PROC_BROWSER_TEST_( | 168 IN_PROC_BROWSER_TEST_( |
169 SupervisedUserTransactionCleanupTest, | 169 SupervisedUserTransactionCleanupTest, |
170 DISABLED_CreateAndCancelSupervisedUser, | 170 DISABLED_CreateAndCancelSupervisedUser, |
171 SupervisedUserTransactionCleanupTest2, | 171 SupervisedUserTransactionCleanupTest2, |
172 testing::internal::GetTypeId<SupervisedUserTransactionCleanupTest>()) { | 172 testing::internal::GetTypeId<SupervisedUserTransactionCleanupTest>()) { |
173 // Make sure there is no supervised user in list. | 173 // Make sure there is no supervised user in list. |
174 ASSERT_EQ(2UL, UserManager::Get()->GetUsers().size()); | 174 ASSERT_EQ(2UL, UserManager::Get()->GetUsers().size()); |
175 } | 175 } |
176 | 176 |
177 } // namespace chromeos | 177 } // namespace chromeos |
OLD | NEW |