| 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 #ifndef CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_TEST_HELPER_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_TEST_HELPER_H_ |
| 6 #define CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_TEST_HELPER_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_TEST_HELPER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 | 77 |
| 78 static void Bind(const base::WeakPtr<EmbeddedWorkerTestHelper>& helper, | 78 static void Bind(const base::WeakPtr<EmbeddedWorkerTestHelper>& helper, |
| 79 mojom::EmbeddedWorkerInstanceClientRequest request); | 79 mojom::EmbeddedWorkerInstanceClientRequest request); |
| 80 | 80 |
| 81 protected: | 81 protected: |
| 82 // Implementation of mojo interfaces. | 82 // Implementation of mojo interfaces. |
| 83 void StartWorker( | 83 void StartWorker( |
| 84 const EmbeddedWorkerStartParams& params, | 84 const EmbeddedWorkerStartParams& params, |
| 85 mojom::ServiceWorkerEventDispatcherRequest dispatcher_request) override; | 85 mojom::ServiceWorkerEventDispatcherRequest dispatcher_request) override; |
| 86 void StopWorker(const StopWorkerCallback& callback) override; | 86 void StopWorker(const StopWorkerCallback& callback) override; |
| 87 void ResumeAfterDownload() override; |
| 88 void AddMessageToConsole(blink::WebConsoleMessage::Level level, |
| 89 const std::string& message) override; |
| 87 | 90 |
| 88 base::WeakPtr<EmbeddedWorkerTestHelper> helper_; | 91 base::WeakPtr<EmbeddedWorkerTestHelper> helper_; |
| 89 mojo::Binding<mojom::EmbeddedWorkerInstanceClient> binding_; | 92 mojo::Binding<mojom::EmbeddedWorkerInstanceClient> binding_; |
| 90 | 93 |
| 91 base::Optional<int> embedded_worker_id_; | 94 base::Optional<int> embedded_worker_id_; |
| 92 | 95 |
| 93 private: | 96 private: |
| 94 DISALLOW_COPY_AND_ASSIGN(MockEmbeddedWorkerInstanceClient); | 97 DISALLOW_COPY_AND_ASSIGN(MockEmbeddedWorkerInstanceClient); |
| 95 }; | 98 }; |
| 96 | 99 |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 std::unique_ptr<MockType> mock = | 286 std::unique_ptr<MockType> mock = |
| 284 base::MakeUnique<MockType>(std::forward<Args>(args)...); | 287 base::MakeUnique<MockType>(std::forward<Args>(args)...); |
| 285 MockType* mock_rawptr = mock.get(); | 288 MockType* mock_rawptr = mock.get(); |
| 286 RegisterMockInstanceClient(std::move(mock)); | 289 RegisterMockInstanceClient(std::move(mock)); |
| 287 return mock_rawptr; | 290 return mock_rawptr; |
| 288 } | 291 } |
| 289 | 292 |
| 290 } // namespace content | 293 } // namespace content |
| 291 | 294 |
| 292 #endif // CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_TEST_HELPER_H_ | 295 #endif // CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_TEST_HELPER_H_ |
| OLD | NEW |