Chromium Code Reviews| Index: chrome/browser/chromeos/policy/cloud_external_data_manager_base_unittest.cc |
| diff --git a/chrome/browser/chromeos/policy/cloud_external_data_manager_base_unittest.cc b/chrome/browser/chromeos/policy/cloud_external_data_manager_base_unittest.cc |
| index 0ef3531095d08cf8bbc9e7534e32cc657a52d6e6..d8c9dd6053de3f29dcd5436feff16bb7bcdb2df7 100644 |
| --- a/chrome/browser/chromeos/policy/cloud_external_data_manager_base_unittest.cc |
| +++ b/chrome/browser/chromeos/policy/cloud_external_data_manager_base_unittest.cc |
| @@ -10,6 +10,7 @@ |
| #include "base/bind.h" |
| #include "base/bind_helpers.h" |
| #include "base/files/scoped_temp_dir.h" |
| +#include "base/logging.h" |
|
bartfab (slow)
2013/11/08 12:40:37
Nit: Where is this used?
Joao da Silva
2013/11/08 14:26:55
Oops, removed
|
| #include "base/message_loop/message_loop.h" |
| #include "base/message_loop/message_loop_proxy.h" |
| #include "base/run_loop.h" |
| @@ -24,13 +25,14 @@ |
| #include "chrome/browser/policy/external_data_fetcher.h" |
| #include "chrome/browser/policy/policy_map.h" |
| #include "chrome/browser/policy/policy_types.h" |
| +#include "chrome/browser/policy/test/policy_test_utils.h" |
| +#include "components/policy/core/common/policy_details.h" |
|
bartfab (slow)
2013/11/08 12:40:37
Nit: Already included by header file.
Joao da Silva
2013/11/08 14:26:55
Done.
|
| #include "net/http/http_status_code.h" |
| #include "net/url_request/test_url_fetcher_factory.h" |
| #include "net/url_request/url_fetcher.h" |
| #include "net/url_request/url_fetcher_delegate.h" |
| #include "net/url_request/url_request_status.h" |
| #include "net/url_request/url_request_test_util.h" |
| -#include "policy/policy_constants.h" |
| #include "testing/gtest/include/gtest/gtest.h" |
| #include "url/gurl.h" |
| @@ -53,15 +55,11 @@ const char k20BytePolicyURL[] = "http://localhost/20_bytes"; |
| const char k10ByteData[] = "10 bytes.."; |
| const char k20ByteData[] = "20 bytes............"; |
| -const PolicyDefinitionList::Entry kPolicyDefinitionListEntries[] = { |
| - { kStringPolicy, base::Value::TYPE_STRING, false, 1, 0 }, |
| - { k10BytePolicy, base::Value::TYPE_DICTIONARY, false, 2, 10 }, |
| - { k20BytePolicy, base::Value::TYPE_DICTIONARY, false, 3, 20 }, |
| -}; |
| - |
| -const PolicyDefinitionList kPolicyDefinitionList = { |
| - kPolicyDefinitionListEntries, |
| - kPolicyDefinitionListEntries + arraysize(kPolicyDefinitionListEntries), |
| +const PolicyDetails kPolicyDetails[] = { |
| +// is_deprecated is_device_policy id max_external_data_size |
| + { false, false, 1, 0 }, |
| + { false, false, 2, 10 }, |
| + { false, false, 3, 20 }, |
| }; |
| const char kCacheKey[] = "data"; |
| @@ -140,6 +138,7 @@ class CloudExternalDataManagerBaseTest : public testing::Test { |
| scoped_ptr<CloudExternalDataManagerBase> external_data_manager_; |
| std::map<int, std::string*> callback_data_; |
| + PolicyDetailsMap policy_details_; |
| DISALLOW_COPY_AND_ASSIGN(CloudExternalDataManagerBaseTest); |
| }; |
| @@ -171,6 +170,10 @@ void CloudExternalDataManagerBaseTest::SetUp() { |
| request_content_getter_ = new net::TestURLRequestContextGetter( |
| base::MessageLoopProxy::current()); |
| + |
| + policy_details_.SetDetails(kStringPolicy, &kPolicyDetails[0]); |
| + policy_details_.SetDetails(k10BytePolicy, &kPolicyDetails[1]); |
| + policy_details_.SetDetails(k20BytePolicy, &kPolicyDetails[2]); |
| } |
| void CloudExternalDataManagerBaseTest::TearDown() { |
| @@ -181,7 +184,7 @@ void CloudExternalDataManagerBaseTest::TearDown() { |
| void CloudExternalDataManagerBaseTest::SetUpExternalDataManager() { |
| external_data_manager_.reset(new CloudExternalDataManagerBase( |
| - &kPolicyDefinitionList, |
| + policy_details_.GetCallback(), |
| message_loop_.message_loop_proxy(), |
| message_loop_.message_loop_proxy())); |
| external_data_manager_->SetExternalDataStore(make_scoped_ptr( |