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

Side by Side Diff: Source/core/workers/WorkerThreadTest.cpp

Issue 1164753004: Tidy up CompositorWorkerManager unit tests. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased Created 5 years, 6 months 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 | Annotate | Revision Log
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 "config.h" 5 #include "config.h"
6 #include "core/workers/WorkerThread.h" 6 #include "core/workers/WorkerThread.h"
7 7
8 #include "core/inspector/ConsoleMessage.h" 8 #include "core/inspector/ConsoleMessage.h"
9 #include "core/workers/WorkerReportingProxy.h" 9 #include "core/workers/WorkerReportingProxy.h"
10 #include "core/workers/WorkerThreadStartupData.h" 10 #include "core/workers/WorkerThreadStartupData.h"
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 } 168 }
169 169
170 void startAndWaitForInit() 170 void startAndWaitForInit()
171 { 171 {
172 OwnPtr<WebWaitableEvent> completionEvent = adoptPtr(Platform::current()- >createWaitableEvent()); 172 OwnPtr<WebWaitableEvent> completionEvent = adoptPtr(Platform::current()- >createWaitableEvent());
173 173
174 OwnPtr<Vector<CSPHeaderAndType>> headers = adoptPtr(new Vector<CSPHeader AndType>()); 174 OwnPtr<Vector<CSPHeaderAndType>> headers = adoptPtr(new Vector<CSPHeader AndType>());
175 CSPHeaderAndType headerAndType("contentSecurityPolicy", ContentSecurityP olicyHeaderTypeReport); 175 CSPHeaderAndType headerAndType("contentSecurityPolicy", ContentSecurityP olicyHeaderTypeReport);
176 headers->append(headerAndType); 176 headers->append(headerAndType);
177 177
178 OwnPtrWillBeRawPtr<WorkerClients> clients = nullptr;
179
178 m_workerThread->start(WorkerThreadStartupData::create( 180 m_workerThread->start(WorkerThreadStartupData::create(
179 KURL(ParsedURLString, "http://fake.url/"), 181 KURL(ParsedURLString, "http://fake.url/"),
180 "fake user agent", 182 "fake user agent",
181 "//fake source code", 183 "//fake source code",
182 nullptr, 184 nullptr,
183 DontPauseWorkerGlobalScopeOnStart, 185 DontPauseWorkerGlobalScopeOnStart,
184 headers.release(), 186 headers.release(),
185 m_securityOrigin.get(), 187 m_securityOrigin.get(),
186 WorkerClients::create(), 188 clients.release(),
187 V8CacheOptionsDefault)); 189 V8CacheOptionsDefault));
188 m_workerThread->backingThread().postTask(FROM_HERE, new SignalTask(compl etionEvent.get())); 190 m_workerThread->backingThread().postTask(FROM_HERE, new SignalTask(compl etionEvent.get()));
189 completionEvent->wait(); 191 completionEvent->wait();
190 } 192 }
191 193
192 void postWakeUpTask(long long waitMs) 194 void postWakeUpTask(long long waitMs)
193 { 195 {
194 WebScheduler* scheduler = m_workerThread->backingThread().platformThread ().scheduler(); 196 WebScheduler* scheduler = m_workerThread->backingThread().platformThread ().scheduler();
195 197
196 // The idle task will get posted on an after wake up queue, so we need a nother task 198 // The idle task will get posted on an after wake up queue, so we need a nother task
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 289
288 completion->wait(); 290 completion->wait();
289 291
290 // Make sure doIdleGc has not been called by this stage. 292 // Make sure doIdleGc has not been called by this stage.
291 Mock::VerifyAndClearExpectations(m_workerThread.get()); 293 Mock::VerifyAndClearExpectations(m_workerThread.get());
292 294
293 m_workerThread->terminateAndWait(); 295 m_workerThread->terminateAndWait();
294 } 296 }
295 297
296 } // namespace blink 298 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/workers/WorkerThreadStartupData.h ('k') | Source/modules/compositorworker/CompositorWorker.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698