OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/service_worker/embedded_worker_instance.h" | 5 #include "content/browser/service_worker/embedded_worker_instance.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 | 144 |
145 private: | 145 private: |
146 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerInstanceTest); | 146 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerInstanceTest); |
147 }; | 147 }; |
148 | 148 |
149 // A helper to simulate the start worker sequence is stalled in a worker | 149 // A helper to simulate the start worker sequence is stalled in a worker |
150 // process. | 150 // process. |
151 class StalledInStartWorkerHelper : public EmbeddedWorkerTestHelper { | 151 class StalledInStartWorkerHelper : public EmbeddedWorkerTestHelper { |
152 public: | 152 public: |
153 StalledInStartWorkerHelper() : EmbeddedWorkerTestHelper(base::FilePath()) {} | 153 StalledInStartWorkerHelper() : EmbeddedWorkerTestHelper(base::FilePath()) {} |
154 ~StalledInStartWorkerHelper() override{}; | 154 ~StalledInStartWorkerHelper() override {} |
155 | 155 |
156 void OnStartWorker(int embedded_worker_id, | 156 void OnStartWorker(int embedded_worker_id, |
157 int64_t service_worker_version_id, | 157 int64_t service_worker_version_id, |
158 const GURL& scope, | 158 const GURL& scope, |
159 const GURL& script_url, | 159 const GURL& script_url, |
160 bool pause_after_download, | 160 bool pause_after_download, |
161 mojom::ServiceWorkerEventDispatcherRequest request, | 161 mojom::ServiceWorkerEventDispatcherRequest request, |
162 mojom::EmbeddedWorkerInstanceHostAssociatedPtrInfo | 162 mojom::EmbeddedWorkerInstanceHostAssociatedPtrInfo |
163 instance_host) override { | 163 instance_host) override { |
164 if (force_stall_in_start_) { | 164 if (force_stall_in_start_) { |
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
829 ASSERT_EQ(1UL, instance_client_rawptr->message().size()); | 829 ASSERT_EQ(1UL, instance_client_rawptr->message().size()); |
830 EXPECT_EQ(test_message, instance_client_rawptr->message()[0]); | 830 EXPECT_EQ(test_message, instance_client_rawptr->message()[0]); |
831 | 831 |
832 // Ensure the worker is stopped. | 832 // Ensure the worker is stopped. |
833 worker->Stop(); | 833 worker->Stop(); |
834 base::RunLoop().RunUntilIdle(); | 834 base::RunLoop().RunUntilIdle(); |
835 EXPECT_EQ(EmbeddedWorkerStatus::STOPPED, worker->status()); | 835 EXPECT_EQ(EmbeddedWorkerStatus::STOPPED, worker->status()); |
836 } | 836 } |
837 | 837 |
838 } // namespace content | 838 } // namespace content |
OLD | NEW |