Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/react-native-fantom/runner/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ module.exports = async function runTest(
: testBytecodeBundlePath,
'--featureFlags',
JSON.stringify(testConfig.flags.common),
'--minLogLevel',
PRINT_FANTOM_OUTPUT ? 'info' : 'error',
]);

if (rnTesterCommandResult.status !== 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ SurfaceHandler::SurfaceHandler(
parameters_.surfaceId = surfaceId;
}

SurfaceHandler::SurfaceHandler(SurfaceId surfaceId) noexcept {
parameters_.surfaceId = surfaceId;
}

SurfaceHandler::SurfaceHandler(SurfaceHandler&& other) noexcept {
operator=(std::move(other));
}
Expand Down Expand Up @@ -81,11 +85,15 @@ void SurfaceHandler::start() const noexcept {

link_.shadowTree = shadowTree.get();

link_.uiManager->startSurface(
std::move(shadowTree),
parameters.moduleName,
parameters.props,
parameters_.displayMode);
if (!parameters.moduleName.empty()) {
link_.uiManager->startSurface(
std::move(shadowTree),
parameters.moduleName,
parameters.props,
parameters_.displayMode);
} else {
link_.uiManager->startEmptySurface(std::move(shadowTree));
}

link_.status = Status::Running;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@ class SurfaceHandler {
* Can be constructed anytime with a `moduleName` and a `surfaceId`.
*/
SurfaceHandler(const std::string& moduleName, SurfaceId surfaceId) noexcept;

/*
* Can be constructed anytime with a `surfaceId`.
* As the module name is not passed, the surface will have to be rendered
* manually by the caller (AppRegistry will not be called).
*/
SurfaceHandler(SurfaceId surfaceId) noexcept;

virtual ~SurfaceHandler() noexcept;

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ void SurfaceManager::startSurface(
});
}

void SurfaceManager::startEmptySurface(
SurfaceId surfaceId,
const LayoutConstraints& layoutConstraints,
const LayoutContext& layoutContext) const noexcept {
startSurface(surfaceId, "", {}, layoutConstraints, layoutContext);
}

void SurfaceManager::stopSurface(SurfaceId surfaceId) const noexcept {
visit(surfaceId, [&](const SurfaceHandler& surfaceHandler) {
surfaceHandler.stop();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ class SurfaceManager final {
const LayoutConstraints& layoutConstraints = {},
const LayoutContext& layoutContext = {}) const noexcept;

void startEmptySurface(
SurfaceId surfaceId,
const LayoutConstraints& layoutConstraints = {},
const LayoutContext& layoutContext = {}) const noexcept;

void stopSurface(SurfaceId surfaceId) const noexcept;

Size measureSurface(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,11 @@ void UIManager::startSurface(
});
}

void UIManager::startEmptySurface(ShadowTree::Unique&& shadowTree) const {
SystraceSection s("UIManager::startEmptySurface");
shadowTreeRegistry_.add(std::move(shadowTree));
}

void UIManager::setSurfaceProps(
SurfaceId surfaceId,
const std::string& moduleName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ class UIManager final : public ShadowTreeDelegate {
const folly::dynamic& props,
DisplayMode displayMode) const;

void startEmptySurface(ShadowTree::Unique&& shadowTree) const;

void setSurfaceProps(
SurfaceId surfaceId,
const std::string& moduleName,
Expand Down
Loading