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

Unified Diff: content/browser/service_worker/service_worker_version_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_version_unittest.cc
diff --git a/content/browser/service_worker/service_worker_version_unittest.cc b/content/browser/service_worker/service_worker_version_unittest.cc
index 9cea769370ce6ad4b5abe8ce8ec366191f85dd1c..6622e5aba83f3cd0b8f73cf300edf1aff2b2f7ea 100644
--- a/content/browser/service_worker/service_worker_version_unittest.cc
+++ b/content/browser/service_worker/service_worker_version_unittest.cc
@@ -33,8 +33,8 @@ static const int kRenderProcessId = 1;
class MessageReceiver : public EmbeddedWorkerTestHelper {
public:
- MessageReceiver(ServiceWorkerContextCore* context)
- : EmbeddedWorkerTestHelper(context, kRenderProcessId),
+ MessageReceiver()
+ : EmbeddedWorkerTestHelper(kRenderProcessId),
current_embedded_worker_id_(0) {}
virtual ~MessageReceiver() {}
@@ -117,16 +117,15 @@ class ServiceWorkerVersionTest : public testing::Test {
: thread_bundle_(TestBrowserThreadBundle::IO_MAINLOOP) {}
virtual void SetUp() OVERRIDE {
- context_.reset(new ServiceWorkerContextCore(base::FilePath(), NULL, NULL));
- helper_.reset(new MessageReceiver(context_.get()));
+ helper_.reset(new MessageReceiver());
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();
@@ -138,11 +137,9 @@ class ServiceWorkerVersionTest : public testing::Test {
version_ = 0;
registration_ = 0;
helper_.reset();
- context_.reset();
}
TestBrowserThreadBundle thread_bundle_;
- scoped_ptr<ServiceWorkerContextCore> context_;
scoped_ptr<MessageReceiver> helper_;
scoped_refptr<ServiceWorkerRegistration> registration_;
scoped_refptr<ServiceWorkerVersion> version_;

Powered by Google App Engine
This is Rietveld 408576698