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/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
731 registration_->SetActiveVersion(version_.get()); | 731 registration_->SetActiveVersion(version_.get()); |
732 version_->DispatchActivateEvent( | 732 version_->DispatchActivateEvent( |
733 CreateReceiver(BrowserThread::UI, done, result)); | 733 CreateReceiver(BrowserThread::UI, done, result)); |
734 } | 734 } |
735 | 735 |
736 void FetchOnIOThread(const base::Closure& done, | 736 void FetchOnIOThread(const base::Closure& done, |
737 bool* prepare_result, | 737 bool* prepare_result, |
738 FetchResult* result) { | 738 FetchResult* result) { |
739 ASSERT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 739 ASSERT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
740 ServiceWorkerFetchRequest request( | 740 ServiceWorkerFetchRequest request( |
741 embedded_test_server()->GetURL("/service_worker/empty.html"), | 741 embedded_test_server()->GetURL("/service_worker/empty.html"), "GET", |
742 "GET", | 742 ServiceWorkerHeaderMap(), Referrer(), false, ServiceWorkerClientInfo()); |
743 ServiceWorkerHeaderMap(), | |
744 Referrer(), | |
745 false); | |
746 version_->SetStatus(ServiceWorkerVersion::ACTIVATED); | 743 version_->SetStatus(ServiceWorkerVersion::ACTIVATED); |
747 version_->DispatchFetchEvent( | 744 version_->DispatchFetchEvent( |
748 request, | 745 request, |
749 CreatePrepareReceiver(prepare_result), | 746 CreatePrepareReceiver(prepare_result), |
750 CreateResponseReceiver( | 747 CreateResponseReceiver( |
751 BrowserThread::UI, done, blob_context_.get(), result)); | 748 BrowserThread::UI, done, blob_context_.get(), result)); |
752 } | 749 } |
753 | 750 |
754 void StopOnIOThread(const base::Closure& done, | 751 void StopOnIOThread(const base::Closure& done, |
755 ServiceWorkerStatusCode* result) { | 752 ServiceWorkerStatusCode* result) { |
(...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1479 ASSERT_EQ(SERVICE_WORKER_OK, status); | 1476 ASSERT_EQ(SERVICE_WORKER_OK, status); |
1480 // Stop the worker. | 1477 // Stop the worker. |
1481 StopWorker(SERVICE_WORKER_OK); | 1478 StopWorker(SERVICE_WORKER_OK); |
1482 // Restart the worker. | 1479 // Restart the worker. |
1483 StartWorker(SERVICE_WORKER_OK); | 1480 StartWorker(SERVICE_WORKER_OK); |
1484 // Stop the worker. | 1481 // Stop the worker. |
1485 StopWorker(SERVICE_WORKER_OK); | 1482 StopWorker(SERVICE_WORKER_OK); |
1486 } | 1483 } |
1487 | 1484 |
1488 } // namespace content | 1485 } // namespace content |
OLD | NEW |