Skip to content

Commit c5ec812

Browse files
committed
Update project loading in PenLayer test
1 parent af12984 commit c5ec812

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

test/penlayer/penlayer_test.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,9 @@ TEST_F(PenLayerTest, DrawLine)
362362

363363
TEST_F(PenLayerTest, Stamp)
364364
{
365+
static const std::chrono::milliseconds timeout(5000);
366+
auto startTime = std::chrono::steady_clock::now();
367+
365368
PenLayer penLayer;
366369
penLayer.setWidth(480);
367370
penLayer.setHeight(360);
@@ -371,7 +374,9 @@ TEST_F(PenLayerTest, Stamp)
371374

372375
ProjectLoader loader;
373376
loader.setFileName("stamp_env.sb3");
374-
loader.start(); // wait until it loads
377+
378+
while (loader.loadStatus() != ProjectLoader::LoadStatus::Loaded)
379+
ASSERT_LE(std::chrono::steady_clock::now(), startTime + timeout);
375380

376381
EXPECT_CALL(engine, stageWidth()).WillRepeatedly(Return(480));
377382
EXPECT_CALL(engine, stageHeight()).WillRepeatedly(Return(360));

0 commit comments

Comments
 (0)