MCPcopy Create free account
hub / github.com/Snapchat/Valdi / ViewNodeTestsDependencies

Method ViewNodeTestsDependencies

valdi/test/utils/ViewNodeTestsUtils.cpp:13–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11}
12
13ViewNodeTestsDependencies::ViewNodeTestsDependencies()
14 : _mainQueue(makeShared<StandaloneMainQueue>()),
15 _mainThreadManager(makeMainThreadManager(_mainQueue->createMainThreadDispatcher())),
16 _attributesManager(_viewManager,
17 _attributeIds,
18 makeShared<ColorPaletteManager>(),
19 ConsoleLogger::getLogger(),
20 Yoga::createConfig(0)),
21 _viewTransactionScope(makeShared<ViewTransactionScope>(&_viewManager, nullptr, false)) {
22 _mainThreadManager->markCurrentThreadIsMainThread();
23
24 _tree = Valdi::makeShared<ViewNodeTree>(makeShared<Context>(0, strongSmallRef(&_attributesManager.getLogger())),
25 nullptr,
26 &_viewManager,
27 nullptr,
28 _mainThreadManager.get(),
29 false);
30 _lock = _tree->lock();
31 _tree->unsafeSetCurrentViewTransactionScope(_viewTransactionScope);
32 // We will update the ViewNode tree ourselves
33 _disableUpdates = _tree->beginDisableUpdates();
34 _tree->unsafeBeginViewTransaction();
35 _viewFactories = Valdi::makeShared<GlobalViewFactories>(_attributesManager);
36
37 _mainQueue->runNextTask();
38}

Callers

nothing calls this directly

Calls 11

makeMainThreadManagerFunction · 0.85
strongSmallRefFunction · 0.85
getLoggerMethod · 0.80
beginDisableUpdatesMethod · 0.80
getMethod · 0.65
lockMethod · 0.45
runNextTaskMethod · 0.45

Tested by

no test coverage detected