OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/file_util.h" | 5 #include "base/file_util.h" |
6 #include "base/message_loop.h" | 6 #include "base/message_loop.h" |
7 #include "base/scoped_temp_dir.h" | 7 #include "base/scoped_temp_dir.h" |
8 #include "chrome/browser/browser_thread.h" | 8 #include "chrome/browser/browser_thread.h" |
9 #include "chrome/browser/net/gaia/token_service.h" | 9 #include "chrome/browser/net/gaia/token_service.h" |
10 #include "chrome/browser/policy/configuration_policy_pref_store.h" | 10 #include "chrome/browser/policy/configuration_policy_pref_store.h" |
11 #include "chrome/browser/policy/configuration_policy_provider.h" | 11 #include "chrome/browser/policy/configuration_policy_provider.h" |
12 #include "chrome/browser/policy/device_management_policy_cache.h" | 12 #include "chrome/browser/policy/device_management_policy_cache.h" |
13 #include "chrome/browser/policy/device_management_policy_provider.h" | 13 #include "chrome/browser/policy/device_management_policy_provider.h" |
14 #include "chrome/browser/policy/mock_configuration_policy_store.h" | 14 #include "chrome/browser/policy/mock_configuration_policy_store.h" |
15 #include "chrome/browser/policy/mock_device_management_backend.h" | 15 #include "chrome/browser/policy/mock_device_management_backend.h" |
16 #include "chrome/common/net/gaia/gaia_constants.h" | 16 #include "chrome/common/net/gaia/gaia_constants.h" |
17 #include "chrome/common/notification_observer_mock.h" | 17 #include "chrome/common/notification_observer_mock.h" |
18 #include "chrome/common/notification_service.h" | 18 #include "chrome/common/notification_service.h" |
19 #include "chrome/common/policy_constants.h" | |
20 #include "chrome/test/testing_device_token_fetcher.h" | 19 #include "chrome/test/testing_device_token_fetcher.h" |
21 #include "chrome/test/testing_profile.h" | 20 #include "chrome/test/testing_profile.h" |
| 21 #include "policy/policy_constants.h" |
22 #include "testing/gmock/include/gmock/gmock.h" | 22 #include "testing/gmock/include/gmock/gmock.h" |
23 #include "testing/gtest/include/gtest/gtest.h" | 23 #include "testing/gtest/include/gtest/gtest.h" |
24 | 24 |
25 const char kTestToken[] = "device_policy_provider_test_auth_token"; | 25 const char kTestToken[] = "device_policy_provider_test_auth_token"; |
26 | 26 |
27 namespace policy { | 27 namespace policy { |
28 | 28 |
29 using ::testing::_; | 29 using ::testing::_; |
30 using ::testing::InSequence; | 30 using ::testing::InSequence; |
31 using ::testing::Mock; | 31 using ::testing::Mock; |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 MockDeviceManagementBackendSucceedRegister()); | 321 MockDeviceManagementBackendSucceedRegister()); |
322 EXPECT_CALL(*backend_, ProcessPolicyRequest(_, _, _, _)).WillOnce( | 322 EXPECT_CALL(*backend_, ProcessPolicyRequest(_, _, _, _)).WillOnce( |
323 MockDeviceManagementBackendSucceedBooleanPolicy(key::kDisableSpdy, true)); | 323 MockDeviceManagementBackendSucceedBooleanPolicy(key::kDisableSpdy, true)); |
324 SimulateSuccessfulLoginAndRunPending(); | 324 SimulateSuccessfulLoginAndRunPending(); |
325 // (3) Since the backend call this time returned a device id, the "unmanaged" | 325 // (3) Since the backend call this time returned a device id, the "unmanaged" |
326 // marker should have been deleted. | 326 // marker should have been deleted. |
327 EXPECT_FALSE(cache(provider_.get())->is_device_unmanaged()); | 327 EXPECT_FALSE(cache(provider_.get())->is_device_unmanaged()); |
328 } | 328 } |
329 | 329 |
330 } // namespace policy | 330 } // namespace policy |
OLD | NEW |