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

Unified Diff: content/browser/service_worker/service_worker_handle_unittest.cc

Issue 238043002: Teach EmbeddedWorkerInstance to create a process when it needs one. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Handle 2 places where context_ could be NULL. Created 6 years, 8 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/service_worker_handle_unittest.cc
diff --git a/content/browser/service_worker/service_worker_handle_unittest.cc b/content/browser/service_worker/service_worker_handle_unittest.cc
index ebc3c745d9267e83b85a3c8619df4fb7e078a14d..70c445613c932fddd2fd0b61e0bfb7bc1ff2ece0 100644
--- a/content/browser/service_worker/service_worker_handle_unittest.cc
+++ b/content/browser/service_worker/service_worker_handle_unittest.cc
@@ -44,17 +44,15 @@ class ServiceWorkerHandleTest : public testing::Test {
: browser_thread_bundle_(TestBrowserThreadBundle::IO_MAINLOOP) {}
virtual void SetUp() OVERRIDE {
- context_.reset(new ServiceWorkerContextCore(base::FilePath(), NULL, NULL));
- helper_.reset(new EmbeddedWorkerTestHelper(context_.get(),
- kRenderProcessId));
+ helper_.reset(new EmbeddedWorkerTestHelper(kRenderProcessId));
registration_ = new ServiceWorkerRegistration(
GURL("http://www.example.com/*"),
GURL("http://www.example.com/service_worker.js"),
- 1L, context_->AsWeakPtr());
+ 1L,
+ helper_->context()->AsWeakPtr());
version_ = new ServiceWorkerVersion(
- registration_,
- 1L, context_->AsWeakPtr());
+ registration_, 1L, helper_->context()->AsWeakPtr());
// Simulate adding one process to the worker.
int embedded_worker_id = version_->embedded_worker()->embedded_worker_id();
@@ -65,13 +63,11 @@ class ServiceWorkerHandleTest : public testing::Test {
registration_ = NULL;
version_ = NULL;
helper_.reset();
- context_.reset();
}
IPC::TestSink* ipc_sink() { return helper_->ipc_sink(); }
TestBrowserThreadBundle browser_thread_bundle_;
- scoped_ptr<ServiceWorkerContextCore> context_;
scoped_ptr<EmbeddedWorkerTestHelper> helper_;
scoped_refptr<ServiceWorkerRegistration> registration_;
scoped_refptr<ServiceWorkerVersion> version_;
@@ -79,8 +75,11 @@ class ServiceWorkerHandleTest : public testing::Test {
};
TEST_F(ServiceWorkerHandleTest, OnVersionStateChanged) {
- scoped_ptr<ServiceWorkerHandle> handle = ServiceWorkerHandle::Create(
- context_->AsWeakPtr(), helper_.get(), 1 /* thread_id */, version_);
+ scoped_ptr<ServiceWorkerHandle> handle =
+ ServiceWorkerHandle::Create(helper_->context()->AsWeakPtr(),
+ helper_.get(),
+ 1 /* thread_id */,
+ version_);
// Start the worker, and then...
ServiceWorkerStatusCode status = SERVICE_WORKER_ERROR_FAILED;

Powered by Google App Engine
This is Rietveld 408576698