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

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

Issue 1154283004: Fix WorkerThreadTest.GcOccursWhileIdle. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: AtLeast 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 { 225 {
226 OwnPtr<WebWaitableEvent> gcDone = adoptPtr(Platform::current()->createWaitab leEvent()); 226 OwnPtr<WebWaitableEvent> gcDone = adoptPtr(Platform::current()->createWaitab leEvent());
227 227
228 ON_CALL(*m_workerThread, doIdleGc(_)).WillByDefault(Invoke( 228 ON_CALL(*m_workerThread, doIdleGc(_)).WillByDefault(Invoke(
229 [&gcDone](double) 229 [&gcDone](double)
230 { 230 {
231 gcDone->signal(); 231 gcDone->signal();
232 return false; 232 return false;
233 })); 233 }));
234 234
235 EXPECT_CALL(*m_workerThread, doIdleGc(_)).Times(1); 235 EXPECT_CALL(*m_workerThread, doIdleGc(_)).Times(testing::AtLeast(1));
236 236
237 startAndWaitForInit(); 237 startAndWaitForInit();
238 postWakeUpTask(500ul); 238 postWakeUpTask(500ul);
239 239
240 gcDone->wait(); 240 gcDone->wait();
241 m_workerThread->terminateAndWait(); 241 m_workerThread->terminateAndWait();
242 }; 242 };
243 243
244 class RepeatingTask : public WebThread::Task { 244 class RepeatingTask : public WebThread::Task {
245 public: 245 public:
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 287
288 completion->wait(); 288 completion->wait();
289 289
290 // Make sure doIdleGc has not been called by this stage. 290 // Make sure doIdleGc has not been called by this stage.
291 Mock::VerifyAndClearExpectations(m_workerThread.get()); 291 Mock::VerifyAndClearExpectations(m_workerThread.get());
292 292
293 m_workerThread->terminateAndWait(); 293 m_workerThread->terminateAndWait();
294 } 294 }
295 295
296 } // namespace blink 296 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698