[modular] Fix & renable flaky tests embed_shell and story_shell

There is a race condition between the story shell getting a ViewOwner
for the module, and the module dropping the ViewOwner on the floor
(because its a test module which doesn't care to draw things on the
screen).  The issue happens when the latter happens first, and the
ViewOwner that the story shell receives is invalid, which causes the
FIDL call to fail (since the FIDL interface requires it to be valid).

Fixes in this patch:
* Hold onto ViewProvider in these test modules indefinitely so ViewOwner
is not dropped on the floor
* unrelated: fix FindAnchor() to use ModuleData::is_embedded, since the
other signal is not accurate.

Additional cleanup:
* Clearer names which would've helped me follow code quicker
(e.g., ProcessPendingStoryShellViews)
* Fix code to follow fuchsia/google C++ style guide (e.g., data types declared
 in the class first).

MF-178
MF-174 #done

TEST=embed_shell and story_shell don't flake for me anymore.

Change-Id: I42250accaf301c10ec66dbdb2df37515f55408a5
8 files changed
tree: 38a227d45fd7cda31ee768fd14e87378527f639a
  1. bin/
  2. boards/
  3. build/
  4. cloud/
  5. docs/
  6. examples/
  7. infra/
  8. lib/
  9. packages/
  10. products/
  11. public/
  12. tests/
  13. third_party/
  14. web/
  15. .clang-format
  16. .clang-tidy
  17. .gitignore
  18. AUTHORS
  19. BUILD.gn
  20. CONTRIBUTING.md
  21. LICENSE
  22. navbar.md
  23. PATENTS
  24. README.md
README.md

Peridot

Peridot is a framework for composed, intelligent and distributed user experiences.

Applications not explicitly designed to interoperate (and possibly implemented in different programming languages) are ephemerally downloaded and dynamically composed to run in a shared context. The framework manages application lifecycle, resources and view hierarchy; and well as context and suggestion infrastructure.

State of Peridot experiences is transparently synchronized across user devices using a distributed offline-first storage system.

Read more