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 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 | 250 |
251 GURL scope_url = https_server()->GetURL(origin, "/"); | 251 GURL scope_url = https_server()->GetURL(origin, "/"); |
252 GURL js_url = https_server()->GetURL(origin, "/?file=worker.js"); | 252 GURL js_url = https_server()->GetURL(origin, "/?file=worker.js"); |
253 | 253 |
254 // Register the worker. | 254 // Register the worker. |
255 BrowserThread::PostTask( | 255 BrowserThread::PostTask( |
256 BrowserThread::IO, FROM_HERE, | 256 BrowserThread::IO, FROM_HERE, |
257 base::BindOnce( | 257 base::BindOnce( |
258 &ServiceWorkerContextWrapper::RegisterServiceWorker, | 258 &ServiceWorkerContextWrapper::RegisterServiceWorker, |
259 base::Unretained(service_worker_context), scope_url, js_url, | 259 base::Unretained(service_worker_context), scope_url, js_url, |
| 260 blink::WebServiceWorkerUpdateViaCache::kImports, |
260 base::Bind( | 261 base::Bind( |
261 &ClearSiteDataThrottleBrowserTest::AddServiceWorkerCallback, | 262 &ClearSiteDataThrottleBrowserTest::AddServiceWorkerCallback, |
262 base::Unretained(this)))); | 263 base::Unretained(this)))); |
263 | 264 |
264 // Wait for its activation. | 265 // Wait for its activation. |
265 base::RunLoop run_loop; | 266 base::RunLoop run_loop; |
266 BrowserThread::PostTask( | 267 BrowserThread::PostTask( |
267 BrowserThread::IO, FROM_HERE, | 268 BrowserThread::IO, FROM_HERE, |
268 base::Bind(&ServiceWorkerActivationObserver::SignalActivation, | 269 base::Bind(&ServiceWorkerActivationObserver::SignalActivation, |
269 base::Unretained(service_worker_context), | 270 base::Unretained(service_worker_context), |
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
860 // Tests that closing the tab right after executing Clear-Site-Data does | 861 // Tests that closing the tab right after executing Clear-Site-Data does |
861 // not crash. | 862 // not crash. |
862 IN_PROC_BROWSER_TEST_F(ClearSiteDataThrottleBrowserTest, ClosedTab) { | 863 IN_PROC_BROWSER_TEST_F(ClearSiteDataThrottleBrowserTest, ClosedTab) { |
863 GURL url = https_server()->GetURL("example.com", "/"); | 864 GURL url = https_server()->GetURL("example.com", "/"); |
864 AddQuery(&url, "header", kClearCookiesHeader); | 865 AddQuery(&url, "header", kClearCookiesHeader); |
865 shell()->LoadURL(url); | 866 shell()->LoadURL(url); |
866 shell()->Close(); | 867 shell()->Close(); |
867 } | 868 } |
868 | 869 |
869 } // namespace content | 870 } // namespace content |
OLD | NEW |