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

Side by Side Diff: content/browser/service_worker/embedded_worker_test_helper.h

Issue 1675613002: service worker: use 200 OK for update requests even in the no update case (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: asan and fix win compile? Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_TEST_HELPER_H_ 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_TEST_HELPER_H_
6 #define CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_TEST_HELPER_H_ 6 #define CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_TEST_HELPER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 protected: 98 protected:
99 // Called when StartWorker, StopWorker and SendMessageToWorker message 99 // Called when StartWorker, StopWorker and SendMessageToWorker message
100 // is sent to the embedded worker. Override if necessary. By default 100 // is sent to the embedded worker. Override if necessary. By default
101 // they verify given parameters and: 101 // they verify given parameters and:
102 // - OnStartWorker calls SimulateWorkerStarted 102 // - OnStartWorker calls SimulateWorkerStarted
103 // - OnStopWorker calls SimulateWorkerStoped 103 // - OnStopWorker calls SimulateWorkerStoped
104 // - OnSendMessageToWorker calls the message's respective On*Event handler 104 // - OnSendMessageToWorker calls the message's respective On*Event handler
105 virtual void OnStartWorker(int embedded_worker_id, 105 virtual void OnStartWorker(int embedded_worker_id,
106 int64_t service_worker_version_id, 106 int64_t service_worker_version_id,
107 const GURL& scope, 107 const GURL& scope,
108 const GURL& script_url); 108 const GURL& script_url,
109 bool pause_after_download);
110 virtual void OnResumeAfterDownload(int embedded_worker_id);
109 virtual void OnStopWorker(int embedded_worker_id); 111 virtual void OnStopWorker(int embedded_worker_id);
110 virtual bool OnMessageToWorker(int thread_id, 112 virtual bool OnMessageToWorker(int thread_id,
111 int embedded_worker_id, 113 int embedded_worker_id,
112 const IPC::Message& message); 114 const IPC::Message& message);
113 115
114 // Called to setup mojo for a new embedded worker. Override to register 116 // Called to setup mojo for a new embedded worker. Override to register
115 // services the worker should expose to the browser. 117 // services the worker should expose to the browser.
116 virtual void OnSetupMojo(ServiceRegistry* service_registry); 118 virtual void OnSetupMojo(ServiceRegistry* service_registry);
117 119
118 // On*Event handlers. Called by the default implementation of 120 // On*Event handlers. Called by the default implementation of
(...skipping 19 matching lines...) Expand all
138 void SimulateWorkerStarted(int embedded_worker_id); 140 void SimulateWorkerStarted(int embedded_worker_id);
139 void SimulateWorkerStopped(int embedded_worker_id); 141 void SimulateWorkerStopped(int embedded_worker_id);
140 void SimulateSend(IPC::Message* message); 142 void SimulateSend(IPC::Message* message);
141 143
142 EmbeddedWorkerRegistry* registry(); 144 EmbeddedWorkerRegistry* registry();
143 145
144 private: 146 private:
145 class MockEmbeddedWorkerSetup; 147 class MockEmbeddedWorkerSetup;
146 148
147 void OnStartWorkerStub(const EmbeddedWorkerMsg_StartWorker_Params& params); 149 void OnStartWorkerStub(const EmbeddedWorkerMsg_StartWorker_Params& params);
150 void OnResumeAfterDownloadStub(int embedded_worker_id);
148 void OnStopWorkerStub(int embedded_worker_id); 151 void OnStopWorkerStub(int embedded_worker_id);
149 void OnMessageToWorkerStub(int thread_id, 152 void OnMessageToWorkerStub(int thread_id,
150 int embedded_worker_id, 153 int embedded_worker_id,
151 const IPC::Message& message); 154 const IPC::Message& message);
152 void OnActivateEventStub(int request_id); 155 void OnActivateEventStub(int request_id);
153 void OnInstallEventStub(int request_id); 156 void OnInstallEventStub(int request_id);
154 void OnFetchEventStub(int request_id, 157 void OnFetchEventStub(int request_id,
155 const ServiceWorkerFetchRequest& request); 158 const ServiceWorkerFetchRequest& request);
156 void OnPushEventStub(int request_id, const PushEventPayload& payload); 159 void OnPushEventStub(int request_id, const PushEventPayload& payload);
157 void OnSetupMojoStub( 160 void OnSetupMojoStub(
(...skipping 30 matching lines...) Expand all
188 message_port_message_filters_; 191 message_port_message_filters_;
189 192
190 base::WeakPtrFactory<EmbeddedWorkerTestHelper> weak_factory_; 193 base::WeakPtrFactory<EmbeddedWorkerTestHelper> weak_factory_;
191 194
192 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerTestHelper); 195 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerTestHelper);
193 }; 196 };
194 197
195 } // namespace content 198 } // namespace content
196 199
197 #endif // CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_TEST_HELPER_H_ 200 #endif // CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_TEST_HELPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698