Chromium Code Reviews| 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 094032b43407845bae7fa818ea4ebb29e612ca3e..1826c1fe94b650277d8e72045d2f9ce06f5d4b80 100644 |
| --- a/content/browser/service_worker/embedded_worker_test_helper.h |
| +++ b/content/browser/service_worker/embedded_worker_test_helper.h |
| @@ -65,9 +65,11 @@ struct ServiceWorkerFetchRequest; |
| class EmbeddedWorkerTestHelper : public IPC::Sender, |
| public IPC::Listener { |
| public: |
| + enum class Event { Activate }; |
| using FetchCallback = |
| base::Callback<void(ServiceWorkerStatusCode, |
| base::Time /* dispatch_event_time */)>; |
| + const std::vector<Event>& dispatched_events() const { return events_; } |
|
Peter Beverloo
2017/02/14 15:48:13
nit: this should be next to the other getters arou
xiaofengzhang
2017/02/15 01:59:45
Acknowledged.
xiaofengzhang
2017/02/15 06:14:44
Done.
|
| class MockEmbeddedWorkerInstanceClient |
| : public mojom::EmbeddedWorkerInstanceClient { |
| @@ -183,7 +185,9 @@ class EmbeddedWorkerTestHelper : public IPC::Sender, |
| // OnMessageToWorker when events are sent to the embedded |
| // worker. By default they just return success via |
| // SimulateSendReplyToBrowser. |
| - virtual void OnActivateEvent(int embedded_worker_id, int request_id); |
| + virtual void OnActivateEvent( |
| + const mojom::ServiceWorkerEventDispatcher::DispatchActivateEventCallback& |
| + callback); |
| virtual void OnExtendableMessageEvent( |
| mojom::ExtendableMessageEventPtr event, |
| const mojom::ServiceWorkerEventDispatcher:: |
| @@ -227,6 +231,7 @@ class EmbeddedWorkerTestHelper : public IPC::Sender, |
| void SimulateSend(IPC::Message* message); |
| EmbeddedWorkerRegistry* registry(); |
| + std::vector<Event> events_; |
|
Peter Beverloo
2017/02/14 15:48:13
This has to be with the other members, probably af
shimazu
2017/02/15 01:29:02
+1 for moving; this should be private.
xiaofengzhang
2017/02/15 01:59:45
Acknowledged.
xiaofengzhang
2017/02/15 02:15:30
sorry, it should be not private, because it will b
shimazu
2017/02/15 02:30:11
Ah, I see. How about protected for |events_| inste
xiaofengzhang
2017/02/15 02:39:30
yeah, here is already protected, do you think ok?
falken
2017/02/15 03:13:24
Technically by the style guide this must be privat
shimazu
2017/02/15 03:14:54
Oops, sorry. Yes, it's good:)
nit: could you add
xiaofengzhang
2017/02/15 06:14:44
Done.
|
| private: |
| class MockServiceWorkerEventDispatcher; |
| @@ -239,7 +244,9 @@ class EmbeddedWorkerTestHelper : public IPC::Sender, |
| void OnMessageToWorkerStub(int thread_id, |
| int embedded_worker_id, |
| const IPC::Message& message); |
| - void OnActivateEventStub(int request_id); |
| + void OnActivateEventStub( |
| + const mojom::ServiceWorkerEventDispatcher::DispatchActivateEventCallback& |
| + callback); |
| void OnExtendableMessageEventStub( |
| mojom::ExtendableMessageEventPtr event, |
| const mojom::ServiceWorkerEventDispatcher:: |