1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_CHROMEOS_POLICY_CLOUD_EXTERNAL_DATA_MANAGER_BASE_TEST_UTIL_H_
6 #define CHROME_BROWSER_CHROMEOS_POLICY_CLOUD_EXTERNAL_DATA_MANAGER_BASE_TEST_UTIL_H_
10 #include "base/callback_forward.h"
11 #include "base/memory/scoped_ptr.h"
14 class DictionaryValue
;
19 class CloudPolicyCore
;
23 // Passes |data| to |destination| and invokes |done_callback| to indicate that
24 // the |data| has been retrieved.
25 void ExternalDataFetchCallback(scoped_ptr
<std::string
>* destination
,
26 const base::Closure
& done_callback
,
27 scoped_ptr
<std::string
> data
);
29 // Constructs a value that points a policy referencing external data at |url|
30 // and sets the expected hash of the external data to that of |data|.
31 scoped_ptr
<base::DictionaryValue
> ConstructExternalDataReference(
32 const std::string
& url
,
33 const std::string
& data
);
35 // TODO(bartfab): Makes an arbitrary |policy| in |core| reference external data
36 // as specified in |metadata|. This is only done because there are no policies
37 // that reference external data yet. Once the first such policy is added, it
38 // will be sufficient to set its value to |metadata| and this method should be
40 void SetExternalDataReference(CloudPolicyCore
* core
,
41 const std::string
& policy
,
42 scoped_ptr
<base::DictionaryValue
> metadata
);
47 #endif // CHROME_BROWSER_CHROMEOS_POLICY_CLOUD_EXTERNAL_DATA_MANAGER_BASE_TEST_UTIL_H_