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/device_token_fetcher.h" | 5 #include "chrome/browser/policy/device_token_fetcher.h" |
6 | 6 |
7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "base/scoped_temp_dir.h" | 8 #include "base/scoped_temp_dir.h" |
9 #include "chrome/browser/policy/cloud_policy_data_store.h" | 9 #include "chrome/browser/policy/cloud_policy_data_store.h" |
10 #include "chrome/browser/policy/logging_work_scheduler.h" | 10 #include "chrome/browser/policy/logging_work_scheduler.h" |
11 #include "chrome/browser/policy/mock_cloud_policy_data_store.h" | 11 #include "chrome/browser/policy/mock_cloud_policy_data_store.h" |
12 #include "chrome/browser/policy/mock_device_management_service.h" | 12 #include "chrome/browser/policy/mock_device_management_service.h" |
13 #include "chrome/browser/policy/policy_notifier.h" | 13 #include "chrome/browser/policy/policy_notifier.h" |
14 #include "chrome/browser/policy/user_policy_cache.h" | 14 #include "chrome/browser/policy/user_policy_cache.h" |
15 #include "content/test/test_browser_thread.h" | 15 #include "content/public/test/test_browser_thread.h" |
16 #include "testing/gmock/include/gmock/gmock.h" | 16 #include "testing/gmock/include/gmock/gmock.h" |
17 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
18 | 18 |
19 namespace em = enterprise_management; | 19 namespace em = enterprise_management; |
20 | 20 |
21 namespace policy { | 21 namespace policy { |
22 | 22 |
23 const char kTestToken[] = "device_token_fetcher_test_auth_token"; | 23 const char kTestToken[] = "device_token_fetcher_test_auth_token"; |
24 | 24 |
25 using content::BrowserThread; | 25 using content::BrowserThread; |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 data_store_->set_known_machine_id(true); | 257 data_store_->set_known_machine_id(true); |
258 FetchToken(&fetcher, data_store_.get()); | 258 FetchToken(&fetcher, data_store_.get()); |
259 loop_.RunAllPending(); | 259 loop_.RunAllPending(); |
260 | 260 |
261 Mock::VerifyAndClearExpectations(&observer_); | 261 Mock::VerifyAndClearExpectations(&observer_); |
262 std::string token = data_store_->device_token(); | 262 std::string token = data_store_->device_token(); |
263 EXPECT_NE("", token); | 263 EXPECT_NE("", token); |
264 } | 264 } |
265 | 265 |
266 } // namespace policy | 266 } // namespace policy |
OLD | NEW |