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

Unified Diff: content/browser/service_worker/embedded_worker_test_helper.cc

Issue 2422793002: HTML MessagePort as mojo::MessagePipeHandle (Closed)
Patch Set: Add missing ScopedAsyncTaskScheduler instance for the new unit tests; required by a recent change t… 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: content/browser/service_worker/embedded_worker_test_helper.cc
diff --git a/content/browser/service_worker/embedded_worker_test_helper.cc b/content/browser/service_worker/embedded_worker_test_helper.cc
index caa07fcff9e03d2e72d947cf45318a344e7e2e20..edaeb0de56ce70ee521434ca8ad28ab14258fe1a 100644
--- a/content/browser/service_worker/embedded_worker_test_helper.cc
+++ b/content/browser/service_worker/embedded_worker_test_helper.cc
@@ -15,7 +15,6 @@
#include "base/memory/ptr_util.h"
#include "base/threading/thread_task_runner_handle.h"
#include "base/time/time.h"
-#include "content/browser/message_port_message_filter.h"
#include "content/browser/service_worker/embedded_worker_instance.h"
#include "content/browser/service_worker/embedded_worker_registry.h"
#include "content/browser/service_worker/embedded_worker_status.h"
@@ -37,28 +36,6 @@
namespace content {
-namespace {
-
-class MockMessagePortMessageFilter : public MessagePortMessageFilter {
- public:
- MockMessagePortMessageFilter()
- : MessagePortMessageFilter(
- base::Bind(&base::AtomicSequenceNumber::GetNext,
- base::Unretained(&next_routing_id_))) {}
-
- bool Send(IPC::Message* message) override {
- message_queue_.push_back(base::WrapUnique(message));
- return true;
- }
-
- private:
- ~MockMessagePortMessageFilter() override {}
- base::AtomicSequenceNumber next_routing_id_;
- std::vector<std::unique_ptr<IPC::Message>> message_queue_;
-};
-
-} // namespace
-
EmbeddedWorkerTestHelper::MockEmbeddedWorkerInstanceClient::
MockEmbeddedWorkerInstanceClient(
base::WeakPtr<EmbeddedWorkerTestHelper> helper)
@@ -235,8 +212,7 @@ EmbeddedWorkerTestHelper::EmbeddedWorkerTestHelper(
base::ThreadTaskRunnerHandle::Get(), nullptr, nullptr);
wrapper_->process_manager()->SetProcessIdForTest(mock_render_process_id());
wrapper_->process_manager()->SetNewProcessIdForTest(new_render_process_id());
- registry()->AddChildProcessSender(mock_render_process_id_, this,
- NewMessagePortMessageFilter());
+ registry()->AddChildProcessSender(mock_render_process_id_, this);
// Setup process level interface registry.
render_process_interface_registry_ =
@@ -252,8 +228,7 @@ EmbeddedWorkerTestHelper::~EmbeddedWorkerTestHelper() {
void EmbeddedWorkerTestHelper::SimulateAddProcessToPattern(const GURL& pattern,
int process_id) {
- registry()->AddChildProcessSender(process_id, this,
- NewMessagePortMessageFilter());
+ registry()->AddChildProcessSender(process_id, this);
wrapper_->process_manager()->AddProcessReferenceToPattern(pattern,
process_id);
}
@@ -628,14 +603,6 @@ EmbeddedWorkerRegistry* EmbeddedWorkerTestHelper::registry() {
return context()->embedded_worker_registry();
}
-MessagePortMessageFilter*
-EmbeddedWorkerTestHelper::NewMessagePortMessageFilter() {
- scoped_refptr<MessagePortMessageFilter> filter(
- new MockMessagePortMessageFilter);
- message_port_message_filters_.push_back(filter);
- return filter.get();
-}
-
std::unique_ptr<service_manager::InterfaceRegistry>
EmbeddedWorkerTestHelper::CreateInterfaceRegistry(MockRenderProcessHost* rph) {
auto registry =

Powered by Google App Engine
This is Rietveld 408576698