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

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

Issue 224733014: Introduce ServiceWorkerHandle for tracking WebServiceWorkerImpl reference (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sigh, rebased 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 unified diff | Download patch | Annotate | Revision Log
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 "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/run_loop.h" 6 #include "base/run_loop.h"
7 #include "content/browser/service_worker/embedded_worker_registry.h" 7 #include "content/browser/service_worker/embedded_worker_registry.h"
8 #include "content/browser/service_worker/embedded_worker_test_helper.h" 8 #include "content/browser/service_worker/embedded_worker_test_helper.h"
9 #include "content/browser/service_worker/service_worker_context_core.h" 9 #include "content/browser/service_worker/service_worker_context_core.h"
10 #include "content/browser/service_worker/service_worker_registration.h" 10 #include "content/browser/service_worker/service_worker_registration.h"
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 version_ = new ServiceWorkerVersion( 115 version_ = new ServiceWorkerVersion(
116 registration_, 116 registration_,
117 1L, context_->AsWeakPtr()); 117 1L, context_->AsWeakPtr());
118 118
119 // Simulate adding one process to the worker. 119 // Simulate adding one process to the worker.
120 int embedded_worker_id = version_->embedded_worker()->embedded_worker_id(); 120 int embedded_worker_id = version_->embedded_worker()->embedded_worker_id();
121 helper_->SimulateAddProcessToWorker(embedded_worker_id, kRenderProcessId); 121 helper_->SimulateAddProcessToWorker(embedded_worker_id, kRenderProcessId);
122 } 122 }
123 123
124 virtual void TearDown() OVERRIDE { 124 virtual void TearDown() OVERRIDE {
125 version_->Shutdown();
126 version_ = 0; 125 version_ = 0;
127 registration_->Shutdown();
128 registration_ = 0; 126 registration_ = 0;
129 helper_.reset(); 127 helper_.reset();
130 context_.reset(); 128 context_.reset();
131 } 129 }
132 130
133 TestBrowserThreadBundle thread_bundle_; 131 TestBrowserThreadBundle thread_bundle_;
134 scoped_ptr<ServiceWorkerContextCore> context_; 132 scoped_ptr<ServiceWorkerContextCore> context_;
135 scoped_ptr<EmbeddedWorkerTestHelper> helper_; 133 scoped_ptr<EmbeddedWorkerTestHelper> helper_;
136 scoped_refptr<ServiceWorkerRegistration> registration_; 134 scoped_refptr<ServiceWorkerRegistration> registration_;
137 scoped_refptr<ServiceWorkerVersion> version_; 135 scoped_refptr<ServiceWorkerVersion> version_;
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 321
324 // Verify that we could successfully observe repeated status changes. 322 // Verify that we could successfully observe repeated status changes.
325 ASSERT_EQ(4U, statuses.size()); 323 ASSERT_EQ(4U, statuses.size());
326 ASSERT_EQ(ServiceWorkerVersion::INSTALLING, statuses[0]); 324 ASSERT_EQ(ServiceWorkerVersion::INSTALLING, statuses[0]);
327 ASSERT_EQ(ServiceWorkerVersion::INSTALLED, statuses[1]); 325 ASSERT_EQ(ServiceWorkerVersion::INSTALLED, statuses[1]);
328 ASSERT_EQ(ServiceWorkerVersion::ACTIVATING, statuses[2]); 326 ASSERT_EQ(ServiceWorkerVersion::ACTIVATING, statuses[2]);
329 ASSERT_EQ(ServiceWorkerVersion::ACTIVE, statuses[3]); 327 ASSERT_EQ(ServiceWorkerVersion::ACTIVE, statuses[3]);
330 } 328 }
331 329
332 } // namespace content 330 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/service_worker/service_worker_version.cc ('k') | content/child/service_worker/service_worker_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698