OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 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. |
| 4 |
| 5 #include "extensions/test/test_content_browser_client.h" |
| 6 |
| 7 #include "base/files/file_util.h" |
| 8 #include "base/json/json_reader.h" |
| 9 #include "base/path_service.h" |
| 10 #include "base/values.h" |
| 11 #include "content/public/common/service_names.mojom.h" |
| 12 #include "extensions/common/extension_paths.h" |
| 13 |
| 14 namespace extensions { |
| 15 |
| 16 TestContentBrowserClient::TestContentBrowserClient() = default; |
| 17 |
| 18 TestContentBrowserClient::~TestContentBrowserClient() = default; |
| 19 |
| 20 std::unique_ptr<base::Value> |
| 21 TestContentBrowserClient::GetServiceManifestOverlay(base::StringPiece name) { |
| 22 if (name != content::mojom::kUtilityServiceName) |
| 23 return nullptr; |
| 24 |
| 25 base::FilePath extensions_test_data_dir; |
| 26 CHECK(base::PathService::Get(DIR_TEST_DATA, &extensions_test_data_dir)); |
| 27 |
| 28 std::string contents; |
| 29 CHECK(base::ReadFileToString( |
| 30 extensions_test_data_dir.AppendASCII( |
| 31 "extensions_test_content_utility_manifest_overlay.json"), |
| 32 &contents)); |
| 33 |
| 34 return base::JSONReader::Read(contents); |
| 35 } |
| 36 |
| 37 } // namespace extensions |
OLD | NEW |