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

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

Issue 931173002: Implement EmbeddedWorkerContextClient.setCachedMetadata/clearCachedMetadata (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix clang failure Created 5 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 #include "content/browser/service_worker/embedded_worker_test_helper.h" 5 #include "content/browser/service_worker/embedded_worker_test_helper.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 208
209 void EmbeddedWorkerTestHelper::SimulateWorkerStopped( 209 void EmbeddedWorkerTestHelper::SimulateWorkerStopped(
210 int embedded_worker_id) { 210 int embedded_worker_id) {
211 EmbeddedWorkerInstance* worker = registry()->GetWorker(embedded_worker_id); 211 EmbeddedWorkerInstance* worker = registry()->GetWorker(embedded_worker_id);
212 if (worker != NULL) 212 if (worker != NULL)
213 registry()->OnWorkerStopped(worker->process_id(), embedded_worker_id); 213 registry()->OnWorkerStopped(worker->process_id(), embedded_worker_id);
214 } 214 }
215 215
216 void EmbeddedWorkerTestHelper::SimulateSend( 216 void EmbeddedWorkerTestHelper::SimulateSend(
217 IPC::Message* message) { 217 IPC::Message* message) {
218 registry()->OnMessageReceived(*message); 218 registry()->OnMessageReceived(*message, mock_render_process_id_);
219 delete message; 219 delete message;
220 } 220 }
221 221
222 void EmbeddedWorkerTestHelper::OnStartWorkerStub( 222 void EmbeddedWorkerTestHelper::OnStartWorkerStub(
223 const EmbeddedWorkerMsg_StartWorker_Params& params) { 223 const EmbeddedWorkerMsg_StartWorker_Params& params) {
224 EmbeddedWorkerInstance* worker = 224 EmbeddedWorkerInstance* worker =
225 registry()->GetWorker(params.embedded_worker_id); 225 registry()->GetWorker(params.embedded_worker_id);
226 ASSERT_TRUE(worker != NULL); 226 ASSERT_TRUE(worker != NULL);
227 EXPECT_EQ(EmbeddedWorkerInstance::STARTING, worker->status()); 227 EXPECT_EQ(EmbeddedWorkerInstance::STARTING, worker->status());
228 base::MessageLoopProxy::current()->PostTask( 228 base::MessageLoopProxy::current()->PostTask(
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 request_id, 305 request_id,
306 request)); 306 request));
307 } 307 }
308 308
309 EmbeddedWorkerRegistry* EmbeddedWorkerTestHelper::registry() { 309 EmbeddedWorkerRegistry* EmbeddedWorkerTestHelper::registry() {
310 DCHECK(context()); 310 DCHECK(context());
311 return context()->embedded_worker_registry(); 311 return context()->embedded_worker_registry();
312 } 312 }
313 313
314 } // namespace content 314 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/service_worker/embedded_worker_registry.cc ('k') | content/browser/service_worker/service_worker_disk_cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698