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/user_policy_cache.h" | 5 #include "chrome/browser/policy/user_policy_cache.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
11 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
12 #include "base/scoped_temp_dir.h" | 12 #include "base/scoped_temp_dir.h" |
13 #include "base/values.h" | 13 #include "base/values.h" |
14 #include "chrome/browser/policy/proto/cloud_policy.pb.h" | 14 #include "chrome/browser/policy/proto/cloud_policy.pb.h" |
15 #include "chrome/browser/policy/proto/device_management_backend.pb.h" | 15 #include "chrome/browser/policy/proto/device_management_backend.pb.h" |
16 #include "chrome/browser/policy/proto/device_management_local.pb.h" | 16 #include "chrome/browser/policy/proto/device_management_local.pb.h" |
17 #include "chrome/browser/policy/proto/old_generic_format.pb.h" | 17 #include "chrome/browser/policy/proto/old_generic_format.pb.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 using content::BrowserThread; | 23 using content::BrowserThread; |
24 using testing::_; | 24 using testing::_; |
25 | 25 |
26 namespace em = enterprise_management; | 26 namespace em = enterprise_management; |
27 | 27 |
28 namespace policy { | 28 namespace policy { |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 UserPolicyCache cache(test_file(), true /* wait_for_policy_fetch */); | 445 UserPolicyCache cache(test_file(), true /* wait_for_policy_fetch */); |
446 EXPECT_FALSE(cache.IsReady()); | 446 EXPECT_FALSE(cache.IsReady()); |
447 cache.SetFetchingDone(); | 447 cache.SetFetchingDone(); |
448 EXPECT_FALSE(cache.IsReady()); | 448 EXPECT_FALSE(cache.IsReady()); |
449 cache.Load(); | 449 cache.Load(); |
450 loop_.RunAllPending(); | 450 loop_.RunAllPending(); |
451 EXPECT_TRUE(cache.IsReady()); | 451 EXPECT_TRUE(cache.IsReady()); |
452 } | 452 } |
453 | 453 |
454 } // namespace policy | 454 } // namespace policy |
OLD | NEW |