| Index: extensions/test/test_content_browser_client.cc
|
| diff --git a/extensions/test/test_content_browser_client.cc b/extensions/test/test_content_browser_client.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..4b83f11433350965071d8e793fa4b30170a70c75
|
| --- /dev/null
|
| +++ b/extensions/test/test_content_browser_client.cc
|
| @@ -0,0 +1,37 @@
|
| +// Copyright 2017 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 "extensions/test/test_content_browser_client.h"
|
| +
|
| +#include "base/files/file_util.h"
|
| +#include "base/json/json_reader.h"
|
| +#include "base/path_service.h"
|
| +#include "base/values.h"
|
| +#include "content/public/common/service_names.mojom.h"
|
| +#include "extensions/common/extension_paths.h"
|
| +
|
| +namespace extensions {
|
| +
|
| +TestContentBrowserClient::TestContentBrowserClient() = default;
|
| +
|
| +TestContentBrowserClient::~TestContentBrowserClient() = default;
|
| +
|
| +std::unique_ptr<base::Value>
|
| +TestContentBrowserClient::GetServiceManifestOverlay(base::StringPiece name) {
|
| + if (name != content::mojom::kUtilityServiceName)
|
| + return nullptr;
|
| +
|
| + base::FilePath extensions_test_data_dir;
|
| + CHECK(base::PathService::Get(DIR_TEST_DATA, &extensions_test_data_dir));
|
| +
|
| + std::string contents;
|
| + CHECK(base::ReadFileToString(
|
| + extensions_test_data_dir.AppendASCII(
|
| + "extensions_test_content_utility_manifest_overlay.json"),
|
| + &contents));
|
| +
|
| + return base::JSONReader::Read(contents);
|
| +}
|
| +
|
| +} // namespace extensions
|
|
|