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

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

Issue 633873002: Service Worker: Respect the "clear on exit" content setting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@contentsettings
Patch Set: just clear in dtor Created 6 years, 2 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
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 #include "base/files/scoped_temp_dir.h" 7 #include "base/files/scoped_temp_dir.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 12 matching lines...) Expand all
23 : io_thread_(BrowserThread::IO, &message_loop_) {} 23 : io_thread_(BrowserThread::IO, &message_loop_) {}
24 24
25 virtual void SetUp() OVERRIDE { 25 virtual void SetUp() OVERRIDE {
26 context_.reset( 26 context_.reset(
27 new ServiceWorkerContextCore(base::FilePath(), 27 new ServiceWorkerContextCore(base::FilePath(),
28 base::ThreadTaskRunnerHandle::Get(), 28 base::ThreadTaskRunnerHandle::Get(),
29 base::ThreadTaskRunnerHandle::Get(), 29 base::ThreadTaskRunnerHandle::Get(),
30 base::ThreadTaskRunnerHandle::Get(), 30 base::ThreadTaskRunnerHandle::Get(),
31 NULL, 31 NULL,
32 NULL, 32 NULL,
33 NULL,
33 NULL)); 34 NULL));
34 context_ptr_ = context_->AsWeakPtr(); 35 context_ptr_ = context_->AsWeakPtr();
35 } 36 }
36 37
37 virtual void TearDown() OVERRIDE { 38 virtual void TearDown() OVERRIDE {
38 context_.reset(); 39 context_.reset();
39 base::RunLoop().RunUntilIdle(); 40 base::RunLoop().RunUntilIdle();
40 } 41 }
41 42
42 class RegistrationListener : public ServiceWorkerRegistration::Listener { 43 class RegistrationListener : public ServiceWorkerRegistration::Listener {
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 scoped_ptr<ServiceWorkerRegistrationHandle> handle( 170 scoped_ptr<ServiceWorkerRegistrationHandle> handle(
170 new ServiceWorkerRegistrationHandle(context_ptr_, 171 new ServiceWorkerRegistrationHandle(context_ptr_,
171 NULL, 172 NULL,
172 kProviderId, 173 kProviderId,
173 registration.get())); 174 registration.get()));
174 registration->NotifyRegistrationFailed(); 175 registration->NotifyRegistrationFailed();
175 // Don't crash when handle gets destructed. 176 // Don't crash when handle gets destructed.
176 } 177 }
177 178
178 } // namespace content 179 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698