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

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

Issue 303733002: Reparent SWProcessManager onto SWContextWrapper. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make sure the ContextCore is destroyed before checking that messages fail Created 6 years, 6 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/service_worker_registration.h" 5 #include "content/browser/service_worker/service_worker_registration.h"
6 6
7 7
8 #include "base/files/scoped_temp_dir.h" 8 #include "base/files/scoped_temp_dir.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
11 #include "base/run_loop.h" 11 #include "base/run_loop.h"
12 #include "content/browser/browser_thread_impl.h" 12 #include "content/browser/browser_thread_impl.h"
13 #include "content/browser/service_worker/service_worker_context_core.h" 13 #include "content/browser/service_worker/service_worker_context_core.h"
14 #include "testing/gtest/include/gtest/gtest.h" 14 #include "testing/gtest/include/gtest/gtest.h"
15 #include "url/gurl.h" 15 #include "url/gurl.h"
16 16
17 namespace content { 17 namespace content {
18 18
19 class ServiceWorkerRegistrationTest : public testing::Test { 19 class ServiceWorkerRegistrationTest : public testing::Test {
20 public: 20 public:
21 ServiceWorkerRegistrationTest() 21 ServiceWorkerRegistrationTest()
22 : io_thread_(BrowserThread::IO, &message_loop_) {} 22 : io_thread_(BrowserThread::IO, &message_loop_) {}
23 23
24 virtual void SetUp() OVERRIDE { 24 virtual void SetUp() OVERRIDE {
25 context_.reset(new ServiceWorkerContextCore( 25 context_.reset(
26 base::FilePath(), 26 new ServiceWorkerContextCore(base::FilePath(),
27 base::MessageLoopProxy::current(), 27 base::MessageLoopProxy::current(),
28 base::MessageLoopProxy::current(), 28 base::MessageLoopProxy::current(),
29 NULL, 29 NULL,
30 NULL, 30 NULL,
31 scoped_ptr<ServiceWorkerProcessManager>())); 31 NULL));
32 context_ptr_ = context_->AsWeakPtr(); 32 context_ptr_ = context_->AsWeakPtr();
33 } 33 }
34 34
35 virtual void TearDown() OVERRIDE { 35 virtual void TearDown() OVERRIDE {
36 context_.reset(); 36 context_.reset();
37 base::RunLoop().RunUntilIdle(); 37 base::RunLoop().RunUntilIdle();
38 } 38 }
39 39
40 protected: 40 protected:
41 scoped_ptr<ServiceWorkerContextCore> context_; 41 scoped_ptr<ServiceWorkerContextCore> context_;
(...skipping 25 matching lines...) Expand all
67 67
68 registration->ActivatePendingVersion(); 68 registration->ActivatePendingVersion();
69 DCHECK_EQ(version_2, registration->active_version()); 69 DCHECK_EQ(version_2, registration->active_version());
70 DCHECK(version_1->HasOneRef()); 70 DCHECK(version_1->HasOneRef());
71 version_1 = NULL; 71 version_1 = NULL;
72 72
73 DCHECK(!version_2->HasOneRef()); 73 DCHECK(!version_2->HasOneRef());
74 } 74 }
75 75
76 } // namespace content 76 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698