| 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 237 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 248 | 248 | 
| 249     GURL scope_url = https_server()->GetURL(origin, "/"); | 249     GURL scope_url = https_server()->GetURL(origin, "/"); | 
| 250     GURL js_url = https_server()->GetURL(origin, "/?file=worker.js"); | 250     GURL js_url = https_server()->GetURL(origin, "/?file=worker.js"); | 
| 251 | 251 | 
| 252     // Register the worker. | 252     // Register the worker. | 
| 253     BrowserThread::PostTask( | 253     BrowserThread::PostTask( | 
| 254         BrowserThread::IO, FROM_HERE, | 254         BrowserThread::IO, FROM_HERE, | 
| 255         base::BindOnce( | 255         base::BindOnce( | 
| 256             &ServiceWorkerContextWrapper::RegisterServiceWorker, | 256             &ServiceWorkerContextWrapper::RegisterServiceWorker, | 
| 257             base::Unretained(service_worker_context), scope_url, js_url, | 257             base::Unretained(service_worker_context), scope_url, js_url, | 
|  | 258             blink::WebServiceWorkerUpdateViaCache::kImports, | 
| 258             base::Bind( | 259             base::Bind( | 
| 259                 &ClearSiteDataThrottleBrowserTest::AddServiceWorkerCallback, | 260                 &ClearSiteDataThrottleBrowserTest::AddServiceWorkerCallback, | 
| 260                 base::Unretained(this)))); | 261                 base::Unretained(this)))); | 
| 261 | 262 | 
| 262     // Wait for its activation. | 263     // Wait for its activation. | 
| 263     base::RunLoop run_loop; | 264     base::RunLoop run_loop; | 
| 264     BrowserThread::PostTask( | 265     BrowserThread::PostTask( | 
| 265         BrowserThread::IO, FROM_HERE, | 266         BrowserThread::IO, FROM_HERE, | 
| 266         base::Bind(&ServiceWorkerActivationObserver::SignalActivation, | 267         base::Bind(&ServiceWorkerActivationObserver::SignalActivation, | 
| 267                    base::Unretained(service_worker_context), | 268                    base::Unretained(service_worker_context), | 
| (...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 881 // Tests that closing the tab right after executing Clear-Site-Data does | 882 // Tests that closing the tab right after executing Clear-Site-Data does | 
| 882 // not crash. | 883 // not crash. | 
| 883 IN_PROC_BROWSER_TEST_F(ClearSiteDataThrottleBrowserTest, ClosedTab) { | 884 IN_PROC_BROWSER_TEST_F(ClearSiteDataThrottleBrowserTest, ClosedTab) { | 
| 884   GURL url = https_server()->GetURL("example.com", "/"); | 885   GURL url = https_server()->GetURL("example.com", "/"); | 
| 885   AddQuery(&url, "header", kClearCookiesHeader); | 886   AddQuery(&url, "header", kClearCookiesHeader); | 
| 886   shell()->LoadURL(url); | 887   shell()->LoadURL(url); | 
| 887   shell()->Close(); | 888   shell()->Close(); | 
| 888 } | 889 } | 
| 889 | 890 | 
| 890 }  // namespace content | 891 }  // namespace content | 
| OLD | NEW | 
|---|