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/policy/cloud_policy_controller.h" | 5 #include "chrome/browser/policy/cloud_policy_controller.h" |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/scoped_temp_dir.h" | 9 #include "base/scoped_temp_dir.h" |
10 #include "chrome/browser/policy/cloud_policy_data_store.h" | 10 #include "chrome/browser/policy/cloud_policy_data_store.h" |
11 #include "chrome/browser/policy/device_token_fetcher.h" | 11 #include "chrome/browser/policy/device_token_fetcher.h" |
12 #include "chrome/browser/policy/logging_work_scheduler.h" | 12 #include "chrome/browser/policy/logging_work_scheduler.h" |
13 #include "chrome/browser/policy/mock_device_management_service.h" | 13 #include "chrome/browser/policy/mock_device_management_service.h" |
14 #include "chrome/browser/policy/policy_notifier.h" | 14 #include "chrome/browser/policy/policy_notifier.h" |
15 #include "chrome/browser/policy/proto/cloud_policy.pb.h" | 15 #include "chrome/browser/policy/proto/cloud_policy.pb.h" |
16 #include "chrome/browser/policy/proto/device_management_backend.pb.h" | 16 #include "chrome/browser/policy/proto/device_management_backend.pb.h" |
17 #include "chrome/browser/policy/user_policy_cache.h" | 17 #include "chrome/browser/policy/user_policy_cache.h" |
18 #include "content/test/test_browser_thread.h" | 18 #include "content/public/test/test_browser_thread.h" |
19 #include "policy/policy_constants.h" | 19 #include "policy/policy_constants.h" |
20 #include "testing/gmock/include/gmock/gmock.h" | 20 #include "testing/gmock/include/gmock/gmock.h" |
21 #include "testing/gtest/include/gtest/gtest.h" | 21 #include "testing/gtest/include/gtest/gtest.h" |
22 | 22 |
23 namespace em = enterprise_management; | 23 namespace em = enterprise_management; |
24 | 24 |
25 namespace policy { | 25 namespace policy { |
26 | 26 |
27 using ::testing::AnyNumber; | 27 using ::testing::AnyNumber; |
28 using ::testing::DoAll; | 28 using ::testing::DoAll; |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 .WillOnce(DoAll(InvokeWithoutArgs(&loop_, &MessageLoop::QuitNow), | 374 .WillOnce(DoAll(InvokeWithoutArgs(&loop_, &MessageLoop::QuitNow), |
375 service_.SucceedJob(response))); | 375 service_.SucceedJob(response))); |
376 CreateNewController(); | 376 CreateNewController(); |
377 loop_.RunAllPending(); | 377 loop_.RunAllPending(); |
378 EXPECT_EQ(CloudPolicySubsystem::NETWORK_ERROR, notifier_.state()); | 378 EXPECT_EQ(CloudPolicySubsystem::NETWORK_ERROR, notifier_.state()); |
379 EXPECT_EQ(CloudPolicySubsystem::POLICY_NETWORK_ERROR, | 379 EXPECT_EQ(CloudPolicySubsystem::POLICY_NETWORK_ERROR, |
380 notifier_.error_details()); | 380 notifier_.error_details()); |
381 } | 381 } |
382 | 382 |
383 } // namespace policy | 383 } // namespace policy |
OLD | NEW |