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(
17 _viewManager, _attributeIds, makeShared<ColorPalette>(), ConsoleLogger::getLogger(), Yoga::createConfig(0)),
18 _viewTransactionScope(makeShared<ViewTransactionScope>(&_viewManager, nullptr, false)) {
19 _mainThreadManager->markCurrentThreadIsMainThread();
20
21 _tree = Valdi::makeShared<ViewNodeTree>(makeShared<Context>(0, strongSmallRef(&_attributesManager.getLogger())),
22 nullptr,
23 &_viewManager,
24 nullptr,
25 _mainThreadManager.get(),
26 false);
27 _lock = _tree->lock();
28 _tree->unsafeSetCurrentViewTransactionScope(_viewTransactionScope);
29 // We will update the ViewNode tree ourselves
30 _disableUpdates = _tree->beginDisableUpdates();
31 _tree->unsafeBeginViewTransaction();
32 _viewFactories = Valdi::makeShared<GlobalViewFactories>(_attributesManager);
33
34 _mainQueue->runNextTask();
35}
36
37ViewNodeTestsDependencies::~ViewNodeTestsDependencies() = default;
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