| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/callback.h" | 6 #include "base/callback.h" |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "content/browser/fileapi/chrome_blob_storage_context.h" | 10 #include "content/browser/fileapi/chrome_blob_storage_context.h" |
| (...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 version_->DispatchActivateEvent( | 449 version_->DispatchActivateEvent( |
| 450 CreateReceiver(BrowserThread::UI, done, result)); | 450 CreateReceiver(BrowserThread::UI, done, result)); |
| 451 } | 451 } |
| 452 | 452 |
| 453 void FetchOnIOThread(const base::Closure& done, FetchResult* result) { | 453 void FetchOnIOThread(const base::Closure& done, FetchResult* result) { |
| 454 ASSERT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 454 ASSERT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 455 ServiceWorkerFetchRequest request( | 455 ServiceWorkerFetchRequest request( |
| 456 embedded_test_server()->GetURL("/service_worker/empty.html"), | 456 embedded_test_server()->GetURL("/service_worker/empty.html"), |
| 457 "GET", | 457 "GET", |
| 458 std::map<std::string, std::string>(), | 458 std::map<std::string, std::string>(), |
| 459 GURL(""), |
| 459 false); | 460 false); |
| 460 version_->SetStatus(ServiceWorkerVersion::ACTIVATED); | 461 version_->SetStatus(ServiceWorkerVersion::ACTIVATED); |
| 461 version_->DispatchFetchEvent( | 462 version_->DispatchFetchEvent( |
| 462 request, CreateResponseReceiver(BrowserThread::UI, done, | 463 request, CreateResponseReceiver(BrowserThread::UI, done, |
| 463 blob_context_, result)); | 464 blob_context_, result)); |
| 464 } | 465 } |
| 465 | 466 |
| 466 void StopOnIOThread(const base::Closure& done, | 467 void StopOnIOThread(const base::Closure& done, |
| 467 ServiceWorkerStatusCode* result) { | 468 ServiceWorkerStatusCode* result) { |
| 468 ASSERT_TRUE(version_); | 469 ASSERT_TRUE(version_); |
| (...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 820 base::Bind(&ServiceWorkerBlackBoxBrowserTest::FindRegistrationOnIO, | 821 base::Bind(&ServiceWorkerBlackBoxBrowserTest::FindRegistrationOnIO, |
| 821 this, | 822 this, |
| 822 embedded_test_server()->GetURL("/service_worker/empty.html"), | 823 embedded_test_server()->GetURL("/service_worker/empty.html"), |
| 823 &status, | 824 &status, |
| 824 &script_url)); | 825 &script_url)); |
| 825 EXPECT_EQ(SERVICE_WORKER_ERROR_NOT_FOUND, status); | 826 EXPECT_EQ(SERVICE_WORKER_ERROR_NOT_FOUND, status); |
| 826 } | 827 } |
| 827 } | 828 } |
| 828 | 829 |
| 829 } // namespace content | 830 } // namespace content |
| OLD | NEW |