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

Unified Diff: extensions/browser/extension_protocols.cc

Issue 2547523004: [Extensions] Allow shared resources between tests via _test_resources (Closed)
Patch Set: . Created 4 years 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
« no previous file with comments | « extensions/browser/extension_protocols.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/extension_protocols.cc
diff --git a/extensions/browser/extension_protocols.cc b/extensions/browser/extension_protocols.cc
index c231083a1b2533c7e094c3d88a128a4ff3f8db8d..5efe573b5b089d4cfecbaa7423b66422cd92d3fb 100644
--- a/extensions/browser/extension_protocols.cc
+++ b/extensions/browser/extension_protocols.cc
@@ -73,6 +73,8 @@ using extensions::SharedModuleInfo;
namespace extensions {
namespace {
+ExtensionProtocolTestHandler* g_test_handler = nullptr;
+
class GeneratedBackgroundPageJob : public net::URLRequestSimpleJob {
public:
GeneratedBackgroundPageJob(net::URLRequest* request,
@@ -523,6 +525,14 @@ ExtensionProtocolHandler::MaybeCreateJob(
return NULL;
}
}
+
+ if (g_test_handler) {
+ net::URLRequestJob* test_job =
+ g_test_handler->Run(request, network_delegate, relative_path);
+ if (test_job)
+ return test_job;
+ }
+
ContentVerifyJob* verify_job = NULL;
ContentVerifier* verifier = extension_info_map_->content_verifier();
if (verifier) {
@@ -590,4 +600,8 @@ CreateExtensionProtocolHandler(bool is_incognito,
extension_info_map);
}
+void SetExtensionProtocolTestHandler(ExtensionProtocolTestHandler* handler) {
+ g_test_handler = handler;
+}
+
} // namespace extensions
« no previous file with comments | « extensions/browser/extension_protocols.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698