Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(88)

Unified Diff: trunk/src/chrome/browser/chromeos/policy/cloud_external_data_manager_base_test_util.cc

Issue 60683002: Revert 233048 "Support policies referencing external data for de..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: trunk/src/chrome/browser/chromeos/policy/cloud_external_data_manager_base_test_util.cc
===================================================================
--- trunk/src/chrome/browser/chromeos/policy/cloud_external_data_manager_base_test_util.cc (revision 233050)
+++ trunk/src/chrome/browser/chromeos/policy/cloud_external_data_manager_base_test_util.cc (working copy)
@@ -1,56 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/chromeos/policy/cloud_external_data_manager_base_test_util.h"
-
-#include "base/callback.h"
-#include "base/memory/weak_ptr.h"
-#include "base/sha1.h"
-#include "base/strings/string_number_conversions.h"
-#include "base/values.h"
-#include "chrome/browser/policy/cloud/cloud_external_data_manager.h"
-#include "chrome/browser/policy/cloud/cloud_policy_core.h"
-#include "chrome/browser/policy/cloud/cloud_policy_store.h"
-#include "chrome/browser/policy/external_data_fetcher.h"
-#include "chrome/browser/policy/policy_map.h"
-#include "chrome/browser/policy/policy_types.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace policy {
-namespace test {
-
-void ExternalDataFetchCallback(scoped_ptr<std::string>* destination,
- const base::Closure& done_callback,
- scoped_ptr<std::string> data) {
- *destination = data.Pass();
- done_callback.Run();
-}
-
-scoped_ptr<base::DictionaryValue> ConstructExternalDataReference(
- const std::string& url,
- const std::string& data) {
- const std::string hash = base::SHA1HashString(data);
- scoped_ptr<base::DictionaryValue> metadata(new base::DictionaryValue);
- metadata->SetStringWithoutPathExpansion("url", url);
- metadata->SetStringWithoutPathExpansion("hash", base::HexEncode(hash.c_str(),
- hash.size()));
- return metadata.Pass();
-}
-
-void SetExternalDataReference(CloudPolicyCore* core,
- const std::string& policy,
- scoped_ptr<base::DictionaryValue> metadata) {
- CloudPolicyStore* store = core->store();
- ASSERT_TRUE(store);
- PolicyMap policy_map;
- policy_map.Set(policy,
- POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
- metadata.release(),
- new ExternalDataFetcher(store->external_data_manager(),
- policy));
- store->SetPolicyMapForTesting(policy_map);
-}
-
-} // namespace test
-} // namespace policy

Powered by Google App Engine
This is Rietveld 408576698