OLD | NEW |
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 11 #include "base/message_loop/message_loop.h" |
11 #include "base/time/time.h" | 12 #include "base/time/time.h" |
12 #include "chrome/browser/chromeos/policy/android_management_client.h" | 13 #include "chrome/browser/chromeos/policy/android_management_client.h" |
13 #include "components/policy/core/common/cloud/mock_device_management_service.h" | 14 #include "components/policy/core/common/cloud/mock_device_management_service.h" |
14 #include "components/signin/core/browser/fake_profile_oauth2_token_service.h" | 15 #include "components/signin/core/browser/fake_profile_oauth2_token_service.h" |
15 #include "net/url_request/url_request_context_getter.h" | 16 #include "net/url_request/url_request_context_getter.h" |
16 #include "net/url_request/url_request_test_util.h" | 17 #include "net/url_request/url_request_test_util.h" |
17 #include "policy/proto/device_management_backend.pb.h" | 18 #include "policy/proto/device_management_backend.pb.h" |
18 #include "testing/gmock/include/gmock/gmock.h" | 19 #include "testing/gmock/include/gmock/gmock.h" |
19 #include "testing/gtest/include/gtest/gtest.h" | 20 #include "testing/gtest/include/gtest/gtest.h" |
20 | 21 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 base::Unretained(&callback_observer_)); | 100 base::Unretained(&callback_observer_)); |
100 | 101 |
101 token_service_.UpdateCredentials(kAccountId, kRefreshToken); | 102 token_service_.UpdateCredentials(kAccountId, kRefreshToken); |
102 client_->StartCheckAndroidManagement(callback); | 103 client_->StartCheckAndroidManagement(callback); |
103 token_service_.IssueAllTokensForAccount(kAccountId, kOAuthToken, | 104 token_service_.IssueAllTokensForAccount(kAccountId, kOAuthToken, |
104 base::Time::Max()); | 105 base::Time::Max()); |
105 ASSERT_LT(client_id.size(), 64U); | 106 ASSERT_LT(client_id.size(), 64U); |
106 } | 107 } |
107 | 108 |
108 } // namespace policy | 109 } // namespace policy |
OLD | NEW |