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

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

Issue 279683002: Initialize ServiceWorkerContextCore with a message loop for the disk cache to use. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | content/browser/service_worker/service_worker_context_core.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/bind.h" 7 #include "base/bind.h"
8 #include "content/browser/service_worker/embedded_worker_instance.h" 8 #include "content/browser/service_worker/embedded_worker_instance.h"
9 #include "content/browser/service_worker/embedded_worker_registry.h" 9 #include "content/browser/service_worker/embedded_worker_registry.h"
10 #include "content/browser/service_worker/service_worker_context_core.h" 10 #include "content/browser/service_worker/service_worker_context_core.h"
11 #include "content/browser/service_worker/service_worker_context_wrapper.h" 11 #include "content/browser/service_worker/service_worker_context_wrapper.h"
12 #include "content/common/service_worker/embedded_worker_messages.h" 12 #include "content/common/service_worker/embedded_worker_messages.h"
13 #include "content/common/service_worker/service_worker_messages.h" 13 #include "content/common/service_worker/service_worker_messages.h"
14 #include "testing/gtest/include/gtest/gtest.h" 14 #include "testing/gtest/include/gtest/gtest.h"
15 15
16 namespace content { 16 namespace content {
17 17
18 static bool AlwaysTrue(int process_id) { 18 static bool AlwaysTrue(int process_id) {
19 return true; 19 return true;
20 } 20 }
21 21
22 EmbeddedWorkerTestHelper::EmbeddedWorkerTestHelper(int mock_render_process_id) 22 EmbeddedWorkerTestHelper::EmbeddedWorkerTestHelper(int mock_render_process_id)
23 : wrapper_(new ServiceWorkerContextWrapper(NULL)), 23 : wrapper_(new ServiceWorkerContextWrapper(NULL)),
24 next_thread_id_(0), 24 next_thread_id_(0),
25 weak_factory_(this) { 25 weak_factory_(this) {
26 wrapper_->InitForTesting(base::FilePath(), 26 wrapper_->InitInternal(base::FilePath(),
27 base::MessageLoopProxy::current(), 27 base::MessageLoopProxy::current(),
28 NULL); 28 base::MessageLoopProxy::current(),
29 NULL);
29 scoped_ptr<ServiceWorkerProcessManager> process_manager( 30 scoped_ptr<ServiceWorkerProcessManager> process_manager(
30 new ServiceWorkerProcessManager(wrapper_)); 31 new ServiceWorkerProcessManager(wrapper_));
31 process_manager->SetProcessRefcountOpsForTest(base::Bind(AlwaysTrue), 32 process_manager->SetProcessRefcountOpsForTest(base::Bind(AlwaysTrue),
32 base::Bind(AlwaysTrue)); 33 base::Bind(AlwaysTrue));
33 wrapper_->context()->SetProcessManagerForTest(process_manager.Pass()); 34 wrapper_->context()->SetProcessManagerForTest(process_manager.Pass());
34 registry()->AddChildProcessSender(mock_render_process_id, this); 35 registry()->AddChildProcessSender(mock_render_process_id, this);
35 } 36 }
36 37
37 EmbeddedWorkerTestHelper::~EmbeddedWorkerTestHelper() { 38 EmbeddedWorkerTestHelper::~EmbeddedWorkerTestHelper() {
38 if (wrapper_) 39 if (wrapper_)
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 request_id, 238 request_id,
238 request)); 239 request));
239 } 240 }
240 241
241 EmbeddedWorkerRegistry* EmbeddedWorkerTestHelper::registry() { 242 EmbeddedWorkerRegistry* EmbeddedWorkerTestHelper::registry() {
242 DCHECK(context()); 243 DCHECK(context());
243 return context()->embedded_worker_registry(); 244 return context()->embedded_worker_registry();
244 } 245 }
245 246
246 } // namespace content 247 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/service_worker/service_worker_context_core.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698