fuchsia: Fix multi-views fallout (#25984)
diff --git a/flow/view_holder.cc b/flow/view_holder.cc
index bf5604e..40c03b3 100644
--- a/flow/view_holder.cc
+++ b/flow/view_holder.cc
@@ -74,7 +74,7 @@
auto binding = bindings->find(id);
FML_DCHECK(binding != bindings->end());
- if (binding->second->view_holder_) {
+ if (binding->second->view_holder_ && on_view_destroyed) {
on_view_destroyed(binding->second->view_holder_->id());
}
bindings->erase(id);
diff --git a/shell/platform/fuchsia/flutter/platform_view.cc b/shell/platform/fuchsia/flutter/platform_view.cc
index 0f1831f..7903167 100644
--- a/shell/platform/fuchsia/flutter/platform_view.cc
+++ b/shell/platform/fuchsia/flutter/platform_view.cc
@@ -483,13 +483,14 @@
return false;
}
+ const std::string is_rendering_str = is_rendering ? "true" : "false";
std::ostringstream out;
out << "{"
<< "\"method\":\"View.viewStateChanged\","
<< "\"args\":{"
<< " \"viewId\":" << view_id_mapping->second << "," // ViewHolderToken
- << " \"is_rendering\":" << is_rendering << "," // IsViewRendering
- << " \"state\":" << is_rendering // IsViewRendering
+ << " \"is_rendering\":" << is_rendering_str << "," // IsViewRendering
+ << " \"state\":" << is_rendering_str // IsViewRendering
<< " }"
<< "}";
auto call = out.str();
diff --git a/shell/platform/fuchsia/flutter/platform_view_unittest.cc b/shell/platform/fuchsia/flutter/platform_view_unittest.cc
index fdb5ec0..ff9c572 100644
--- a/shell/platform/fuchsia/flutter/platform_view_unittest.cc
+++ b/shell/platform/fuchsia/flutter/platform_view_unittest.cc
@@ -877,9 +877,9 @@
<< "{"
<< "\"method\":\"View.viewStateChanged\","
<< "\"args\":{"
- << " \"viewId\":" << kViewId << "," // ViewHolderToken
- << " \"is_rendering\":" << true << "," // IsViewRendering
- << " \"state\":" << true // IsViewRendering
+ << " \"viewId\":" << kViewId << "," // ViewHolderToken
+ << " \"is_rendering\":true," // IsViewRendering
+ << " \"state\":true" // IsViewRendering
<< " }"
<< "}";
EXPECT_EQ(view_state_changed_expected_out.str(),