Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(97)

Side by Side Diff: third_party/WebKit/Source/web/WebEmbeddedWorkerImplTest.cpp

Issue 2517223002: Move content/renderer/background_sync to Blink (Closed)
Patch Set: Fix broken WebEmbeddedWorker test Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "public/web/WebEmbeddedWorker.h" 5 #include "public/web/WebEmbeddedWorker.h"
6 6
7 #include "platform/testing/URLTestHelpers.h" 7 #include "platform/testing/URLTestHelpers.h"
8 #include "platform/testing/UnitTestHelpers.h" 8 #include "platform/testing/UnitTestHelpers.h"
9 #include "public/platform/InterfaceRegistry.h"
9 #include "public/platform/Platform.h" 10 #include "public/platform/Platform.h"
10 #include "public/platform/WebURLLoaderMockFactory.h" 11 #include "public/platform/WebURLLoaderMockFactory.h"
11 #include "public/platform/WebURLResponse.h" 12 #include "public/platform/WebURLResponse.h"
12 #include "public/platform/modules/serviceworker/WebServiceWorkerProvider.h" 13 #include "public/platform/modules/serviceworker/WebServiceWorkerProvider.h"
13 #include "public/web/WebCache.h" 14 #include "public/web/WebCache.h"
14 #include "public/web/WebEmbeddedWorkerStartData.h" 15 #include "public/web/WebEmbeddedWorkerStartData.h"
15 #include "public/web/WebSettings.h" 16 #include "public/web/WebSettings.h"
16 #include "public/web/modules/serviceworker/WebServiceWorkerContextClient.h" 17 #include "public/web/modules/serviceworker/WebServiceWorkerContextClient.h"
17 #include "testing/gmock/include/gmock/gmock.h" 18 #include "testing/gmock/include/gmock/gmock.h"
18 #include "testing/gtest/include/gtest/gtest.h" 19 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 void navigate(const WebString& uuid, 69 void navigate(const WebString& uuid,
69 const WebURL&, 70 const WebURL&,
70 WebServiceWorkerClientCallbacks*) override { 71 WebServiceWorkerClientCallbacks*) override {
71 NOTREACHED(); 72 NOTREACHED();
72 } 73 }
73 void registerForeignFetchScopes( 74 void registerForeignFetchScopes(
74 const WebVector<WebURL>& subScopes, 75 const WebVector<WebURL>& subScopes,
75 const WebVector<WebSecurityOrigin>& origins) override { 76 const WebVector<WebSecurityOrigin>& origins) override {
76 NOTREACHED(); 77 NOTREACHED();
77 } 78 }
79 InterfaceRegistry* interfaceRegistry() {
80 return InterfaceRegistry::getEmptyInterfaceRegistry();
81 }
78 82
79 private: 83 private:
80 bool m_hasAssociatedRegistration; 84 bool m_hasAssociatedRegistration;
81 }; 85 };
82 86
83 class WebEmbeddedWorkerImplTest : public ::testing::Test { 87 class WebEmbeddedWorkerImplTest : public ::testing::Test {
84 protected: 88 protected:
85 void SetUp() override { 89 void SetUp() override {
86 m_mockClient = new MockServiceWorkerContextClient(); 90 m_mockClient = new MockServiceWorkerContextClient();
87 m_worker = wrapUnique(WebEmbeddedWorker::create(m_mockClient, nullptr)); 91 m_worker = wrapUnique(WebEmbeddedWorker::create(m_mockClient, nullptr));
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 ::testing::Mock::VerifyAndClearExpectations(m_mockClient); 288 ::testing::Mock::VerifyAndClearExpectations(m_mockClient);
285 289
286 // Resume after download. 290 // Resume after download.
287 EXPECT_CALL(*m_mockClient, createServiceWorkerProvider()) 291 EXPECT_CALL(*m_mockClient, createServiceWorkerProvider())
288 .WillOnce(::testing::Return(nullptr)); 292 .WillOnce(::testing::Return(nullptr));
289 m_worker->resumeAfterDownload(); 293 m_worker->resumeAfterDownload();
290 ::testing::Mock::VerifyAndClearExpectations(m_mockClient); 294 ::testing::Mock::VerifyAndClearExpectations(m_mockClient);
291 } 295 }
292 296
293 } // namespace blink 297 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698