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 <vector> | 5 #include <vector> |
6 | 6 |
| 7 #include "base/files/scoped_temp_dir.h" |
7 #include "base/logging.h" | 8 #include "base/logging.h" |
8 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
9 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
10 #include "base/scoped_temp_dir.h" | |
11 #include "base/values.h" | 11 #include "base/values.h" |
12 #include "chrome/browser/browser_process.h" | 12 #include "chrome/browser/browser_process.h" |
13 #include "chrome/browser/policy/cloud_policy_data_store.h" | 13 #include "chrome/browser/policy/cloud_policy_data_store.h" |
14 #include "chrome/browser/policy/logging_work_scheduler.h" | 14 #include "chrome/browser/policy/logging_work_scheduler.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/testing_cloud_policy_subsystem.h" | 17 #include "chrome/browser/policy/testing_cloud_policy_subsystem.h" |
18 #include "chrome/browser/policy/testing_policy_url_fetcher_factory.h" | 18 #include "chrome/browser/policy/testing_policy_url_fetcher_factory.h" |
19 #include "chrome/browser/policy/user_policy_cache.h" | 19 #include "chrome/browser/policy/user_policy_cache.h" |
20 #include "chrome/common/pref_names.h" | 20 #include "chrome/common/pref_names.h" |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 | 238 |
239 // Length and max number of requests for the subsequent intervals. | 239 // Length and max number of requests for the subsequent intervals. |
240 length = 60 * 60 * 1000; // 60 minutes | 240 length = 60 * 60 * 1000; // 60 minutes |
241 limit = 12; // maxminum nr of requests in the next 60 minutes | 241 limit = 12; // maxminum nr of requests in the next 60 minutes |
242 } | 242 } |
243 | 243 |
244 EXPECT_GE(count, 11) | 244 EXPECT_GE(count, 11) |
245 << "No enough requests were fired during the test run."; | 245 << "No enough requests were fired during the test run."; |
246 } | 246 } |
247 | 247 |
248 ScopedTempDir temp_user_data_dir_; | 248 base::ScopedTempDir temp_user_data_dir_; |
249 | 249 |
250 MessageLoop loop_; | 250 MessageLoop loop_; |
251 content::TestBrowserThread ui_thread_; | 251 content::TestBrowserThread ui_thread_; |
252 content::TestBrowserThread file_thread_; | 252 content::TestBrowserThread file_thread_; |
253 content::TestBrowserThread io_thread_; | 253 content::TestBrowserThread io_thread_; |
254 | 254 |
255 scoped_ptr<EventLogger> logger_; | 255 scoped_ptr<EventLogger> logger_; |
256 scoped_ptr<CloudPolicyDataStore> data_store_; | 256 scoped_ptr<CloudPolicyDataStore> data_store_; |
257 scoped_ptr<CloudPolicySubsystem> cloud_policy_subsystem_; | 257 scoped_ptr<CloudPolicySubsystem> cloud_policy_subsystem_; |
258 scoped_ptr<PrefService> prefs_; | 258 scoped_ptr<PrefService> prefs_; |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
460 TEST_F(CloudPolicySubsystemSerialNumberRecoveryTest, SerialRequested) { | 460 TEST_F(CloudPolicySubsystemSerialNumberRecoveryTest, SerialRequested) { |
461 InSequence s; | 461 InSequence s; |
462 ExpectSuccessfulRegistration(); | 462 ExpectSuccessfulRegistration(); |
463 ExpectPolicyRequest("", true, true); | 463 ExpectPolicyRequest("", true, true); |
464 ExpectPolicyRequest(kMachineId, false, false); | 464 ExpectPolicyRequest(kMachineId, false, false); |
465 ExpectPolicyRequest("", false, false); | 465 ExpectPolicyRequest("", false, false); |
466 ExecuteTest(); | 466 ExecuteTest(); |
467 } | 467 } |
468 | 468 |
469 } // policy | 469 } // policy |
OLD | NEW |