OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/browsing_data/clear_site_data_throttle.h" | 5 #include "content/browser/browsing_data/clear_site_data_throttle.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 | 247 |
248 GURL scope_url = https_server()->GetURL(origin, "/"); | 248 GURL scope_url = https_server()->GetURL(origin, "/"); |
249 GURL js_url = https_server()->GetURL(origin, "/?file=worker.js"); | 249 GURL js_url = https_server()->GetURL(origin, "/?file=worker.js"); |
250 | 250 |
251 // Register the worker. | 251 // Register the worker. |
252 BrowserThread::PostTask( | 252 BrowserThread::PostTask( |
253 BrowserThread::IO, FROM_HERE, | 253 BrowserThread::IO, FROM_HERE, |
254 base::BindOnce( | 254 base::BindOnce( |
255 &ServiceWorkerContextWrapper::RegisterServiceWorker, | 255 &ServiceWorkerContextWrapper::RegisterServiceWorker, |
256 base::Unretained(service_worker_context), scope_url, js_url, | 256 base::Unretained(service_worker_context), scope_url, js_url, |
| 257 blink::WebServiceWorkerUpdateViaCache::kImports, |
257 base::Bind( | 258 base::Bind( |
258 &ClearSiteDataThrottleBrowserTest::AddServiceWorkerCallback, | 259 &ClearSiteDataThrottleBrowserTest::AddServiceWorkerCallback, |
259 base::Unretained(this)))); | 260 base::Unretained(this)))); |
260 | 261 |
261 // Wait for its activation. | 262 // Wait for its activation. |
262 base::RunLoop run_loop; | 263 base::RunLoop run_loop; |
263 BrowserThread::PostTask( | 264 BrowserThread::PostTask( |
264 BrowserThread::IO, FROM_HERE, | 265 BrowserThread::IO, FROM_HERE, |
265 base::Bind(&ServiceWorkerActivationObserver::SignalActivation, | 266 base::Bind(&ServiceWorkerActivationObserver::SignalActivation, |
266 base::Unretained(service_worker_context), | 267 base::Unretained(service_worker_context), |
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
857 // Tests that closing the tab right after executing Clear-Site-Data does | 858 // Tests that closing the tab right after executing Clear-Site-Data does |
858 // not crash. | 859 // not crash. |
859 IN_PROC_BROWSER_TEST_F(ClearSiteDataThrottleBrowserTest, ClosedTab) { | 860 IN_PROC_BROWSER_TEST_F(ClearSiteDataThrottleBrowserTest, ClosedTab) { |
860 GURL url = https_server()->GetURL("example.com", "/"); | 861 GURL url = https_server()->GetURL("example.com", "/"); |
861 AddQuery(&url, "header", kClearCookiesHeader); | 862 AddQuery(&url, "header", kClearCookiesHeader); |
862 shell()->LoadURL(url); | 863 shell()->LoadURL(url); |
863 shell()->Close(); | 864 shell()->Close(); |
864 } | 865 } |
865 | 866 |
866 } // namespace content | 867 } // namespace content |
OLD | NEW |