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

Side by Side Diff: Source/core/dom/ScriptRunnerTest.cpp

Issue 1028653002: Oilpan: fix webkit unit tests following r192243 (reland). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 9 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/dom/ScriptRunner.h" 6 #include "core/dom/ScriptRunner.h"
7 7
8 #include "core/dom/Document.h" 8 #include "core/dom/Document.h"
9 #include "core/dom/ScriptLoader.h" 9 #include "core/dom/ScriptLoader.h"
10 #include "platform/heap/Handle.h" 10 #include "platform/heap/Handle.h"
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 EXPECT_THAT(m_order, ElementsAre(1)); 375 EXPECT_THAT(m_order, ElementsAre(1));
376 376
377 // Make sure the interrupted tasks are executed next 'tick'. 377 // Make sure the interrupted tasks are executed next 'tick'.
378 m_platform.setShouldYield(false); 378 m_platform.setShouldYield(false);
379 m_platform.runSingleTask(); 379 m_platform.runSingleTask();
380 EXPECT_THAT(m_order, ElementsAre(1, 2, 3)); 380 EXPECT_THAT(m_order, ElementsAre(1, 2, 3));
381 } 381 }
382 382
383 TEST_F(ScriptRunnerTest, QueueReentrantScript_ManyAsyncScripts) 383 TEST_F(ScriptRunnerTest, QueueReentrantScript_ManyAsyncScripts)
384 { 384 {
385 OwnPtr<MockScriptLoader> scriptLoaders[20]; 385 OwnPtrWillBeRawPtr<MockScriptLoader> scriptLoaders[20];
386 for (int i = 0; i < 20; i++)
387 scriptLoaders[i] = nullptr;
haraken 2015/03/20 14:07:42 What is this nullptr assignment for?
sof 2015/03/20 14:15:16 Being tidy wrt RawPtr<> zero initialization, nothi
388
386 for (int i = 0; i < 20; i++) { 389 for (int i = 0; i < 20; i++) {
387 scriptLoaders[i] = adoptPtr(new MockScriptLoader(m_element.get())); 390 scriptLoaders[i] = adoptPtrWillBeNoop(new MockScriptLoader(m_element.get ()));
388 EXPECT_CALL(*scriptLoaders[i], isReady()).WillRepeatedly(Return(true)); 391 EXPECT_CALL(*scriptLoaders[i], isReady()).WillRepeatedly(Return(true));
389 392
390 m_scriptRunner->queueScriptForExecution(scriptLoaders[i].get(), ScriptRu nner::ASYNC_EXECUTION); 393 m_scriptRunner->queueScriptForExecution(scriptLoaders[i].get(), ScriptRu nner::ASYNC_EXECUTION);
391 394
392 if (i > 0) { 395 if (i > 0) {
393 EXPECT_CALL(*scriptLoaders[i], execute()).WillOnce(Invoke([this, i] { 396 EXPECT_CALL(*scriptLoaders[i], execute()).WillOnce(Invoke([this, i] {
394 m_order.push_back(i); 397 m_order.push_back(i);
395 })); 398 }));
396 } 399 }
397 } 400 }
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 testing::Mock::VerifyAndClear(&scriptLoader2); 509 testing::Mock::VerifyAndClear(&scriptLoader2);
507 testing::Mock::VerifyAndClear(&scriptLoader3); 510 testing::Mock::VerifyAndClear(&scriptLoader3);
508 EXPECT_CALL(scriptLoader2, execute()).Times(1); 511 EXPECT_CALL(scriptLoader2, execute()).Times(1);
509 EXPECT_CALL(scriptLoader3, execute()).Times(1); 512 EXPECT_CALL(scriptLoader3, execute()).Times(1);
510 EXPECT_CALL(scriptLoader2, isReady()).WillRepeatedly(Return(true)); 513 EXPECT_CALL(scriptLoader2, isReady()).WillRepeatedly(Return(true));
511 EXPECT_CALL(scriptLoader3, isReady()).WillRepeatedly(Return(true)); 514 EXPECT_CALL(scriptLoader3, isReady()).WillRepeatedly(Return(true));
512 m_platform.runAllTasks(); 515 m_platform.runAllTasks();
513 } 516 }
514 517
515 } // namespace blink 518 } // 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