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

Unified Diff: extensions/test/test_content_browser_client.cc

Issue 2697463002: Convert utility process extension Unpacker IPC to mojo (Closed)
Patch Set: Use MakeUnique when creating the utility mojo client. Created 3 years, 10 months 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: 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..4acb04dbba27a6d2bda15d3cbc1a7bdc088244a6
--- /dev/null
+++ b/extensions/test/test_content_browser_client.cc
@@ -0,0 +1,42 @@
+// 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;
+ if (!base::PathService::Get(DIR_TEST_DATA, &extensions_test_data)) {
+ NOTREACHED();
Devlin 2017/02/14 17:24:59 nit: Given this is test-only code, these may as we
Noel Gordon 2017/02/15 17:28:09 Done.
+ }
+
+ std::string content;
+ if (!base::ReadFileToString(
+ extensions_test_data.AppendASCII(
+ "extensions_test_content_utility_manifest_overlay.json"),
+ &content)) {
+ NOTREACHED();
+ }
+
+ return base::JSONReader::Read(content);
+}
+
+} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698