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

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

Issue 2628553002: ServiceWorker: OnSimpleEventFinished could be called after timed out (Closed)
Patch Set: Updated a unittest Created 3 years, 11 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.h
diff --git a/content/browser/service_worker/embedded_worker_test_helper.h b/content/browser/service_worker/embedded_worker_test_helper.h
index 108327d1f66b3f185b198b5921e54e7cf8d12e97..2d8be73201147b1eb4fa6aa8621db15cfb26ccfe 100644
--- a/content/browser/service_worker/embedded_worker_test_helper.h
+++ b/content/browser/service_worker/embedded_worker_test_helper.h
@@ -157,26 +157,24 @@ class EmbeddedWorkerTestHelper : public IPC::Sender,
// Called when StartWorker, StopWorker and SendMessageToWorker message
// is sent to the embedded worker. Override if necessary. By default
// they verify given parameters and:
- // - OnStartWorker calls SimulateWorkerStarted
- // - OnStopWorker calls SimulateWorkerStoped
+ // - OnStartWorker calls SimulateWorkerStarted and binds |request| to
+ // MockServiceWorkerEventDispatcher
+ // - OnStopWorker calls StopWorkerCallback
falken 2017/01/11 06:31:55 At first glance this seems weird. Why isn't someth
shimazu 2017/01/12 01:45:24 It's because real IPCs can be sent through mojo. C
// - OnSendMessageToWorker calls the message's respective On*Event handler
falken 2017/01/11 06:31:55 Seems like this would read better as individual co
shimazu 2017/01/12 01:45:24 Done.
- virtual void OnStartWorker(int embedded_worker_id,
- int64_t service_worker_version_id,
- const GURL& scope,
- const GURL& script_url,
- bool pause_after_download);
+ virtual void OnStartWorker(
+ int embedded_worker_id,
+ int64_t service_worker_version_id,
+ const GURL& scope,
+ const GURL& script_url,
+ bool pause_after_download,
+ mojom::ServiceWorkerEventDispatcherRequest request);
virtual void OnResumeAfterDownload(int embedded_worker_id);
- virtual void OnStopWorker(int embedded_worker_id);
+ virtual void OnStopWorker(
+ const mojom::EmbeddedWorkerInstanceClient::StopWorkerCallback& callback);
virtual bool OnMessageToWorker(int thread_id,
int embedded_worker_id,
const IPC::Message& message);
- // Called to setup mojo for a new embedded worker. Override to register
- // interfaces the worker should expose to the browser.
- virtual void OnSetupMojo(
- int thread_id,
- mojom::ServiceWorkerEventDispatcherRequest dispatcher_request);
-
// On*Event handlers. Called by the default implementation of
// OnMessageToWorker when events are sent to the embedded
// worker. By default they just return success via
@@ -213,9 +211,11 @@ class EmbeddedWorkerTestHelper : public IPC::Sender,
class MockEmbeddedWorkerSetup;
class MockServiceWorkerEventDispatcher;
- void OnStartWorkerStub(const EmbeddedWorkerStartParams& params);
+ void OnStartWorkerStub(const EmbeddedWorkerStartParams& params,
+ mojom::ServiceWorkerEventDispatcherRequest request);
void OnResumeAfterDownloadStub(int embedded_worker_id);
- void OnStopWorkerStub(int embedded_worker_id);
+ void OnStopWorkerStub(
+ const mojom::EmbeddedWorkerInstanceClient::StopWorkerCallback& callback);
void OnMessageToWorkerStub(int thread_id,
int embedded_worker_id,
const IPC::Message& message);

Powered by Google App Engine
This is Rietveld 408576698