| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "config.h" | 5 #include "config.h" |
| 6 #include "public/web/WebEmbeddedWorker.h" | 6 #include "public/web/WebEmbeddedWorker.h" |
| 7 | 7 |
| 8 #include "platform/testing/URLTestHelpers.h" | 8 #include "platform/testing/URLTestHelpers.h" |
| 9 #include "platform/testing/UnitTestHelpers.h" | 9 #include "platform/testing/UnitTestHelpers.h" |
| 10 #include "public/platform/Platform.h" | 10 #include "public/platform/Platform.h" |
| 11 #include "public/platform/WebURLResponse.h" | 11 #include "public/platform/WebURLResponse.h" |
| 12 #include "public/platform/WebUnitTestSupport.h" | 12 #include "public/platform/WebUnitTestSupport.h" |
| 13 #include "public/web/WebEmbeddedWorkerStartData.h" | 13 #include "public/web/WebEmbeddedWorkerStartData.h" |
| 14 #include "public/web/WebServiceWorkerContextClient.h" | |
| 15 #include "public/web/WebSettings.h" | 14 #include "public/web/WebSettings.h" |
| 15 #include "public/web/modules/serviceworker/WebServiceWorkerContextClient.h" |
| 16 #include <gmock/gmock.h> | 16 #include <gmock/gmock.h> |
| 17 #include <gtest/gtest.h> | 17 #include <gtest/gtest.h> |
| 18 | 18 |
| 19 namespace blink { | 19 namespace blink { |
| 20 namespace { | 20 namespace { |
| 21 | 21 |
| 22 class MockServiceWorkerContextClient | 22 class MockServiceWorkerContextClient |
| 23 : public WebServiceWorkerContextClient { | 23 : public WebServiceWorkerContextClient { |
| 24 public: | 24 public: |
| 25 MockServiceWorkerContextClient() { } | 25 MockServiceWorkerContextClient() { } |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 EXPECT_CALL(*m_mockClient, createServiceWorkerNetworkProvider(::testing::_))
.WillOnce(::testing::Return(nullptr)); | 84 EXPECT_CALL(*m_mockClient, createServiceWorkerNetworkProvider(::testing::_))
.WillOnce(::testing::Return(nullptr)); |
| 85 testing::runPendingTasks(); | 85 testing::runPendingTasks(); |
| 86 ::testing::Mock::VerifyAndClearExpectations(m_mockClient); | 86 ::testing::Mock::VerifyAndClearExpectations(m_mockClient); |
| 87 | 87 |
| 88 EXPECT_CALL(*m_mockClient, workerContextFailedToStart()).Times(1); | 88 EXPECT_CALL(*m_mockClient, workerContextFailedToStart()).Times(1); |
| 89 m_worker->terminateWorkerContext(); | 89 m_worker->terminateWorkerContext(); |
| 90 ::testing::Mock::VerifyAndClearExpectations(m_mockClient); | 90 ::testing::Mock::VerifyAndClearExpectations(m_mockClient); |
| 91 } | 91 } |
| 92 | 92 |
| 93 } // namespace blink | 93 } // namespace blink |
| OLD | NEW |