Currently, the ChromeRenderViewTest::SetUp() calls the content::RenderViewTest::SetUp() and then proceeds to create the three test agents (autofill agent, password agent and password generation agent).
This means, any event dispatched on creation of a render frame (like FocusedNodeChanged) will be sent to instances of the agents that is replaced shortly after with test agents.
For lazy-initialized mojo bindings (e.g. PasswordManagerDriver and PasswordManagerClient), this means the binding may or may not be bound twice, depending on how the agents react to RenderFrameObserver events.
A clean solution could for example use a factory to create the agents and tests could inject the correct test instances beforehand to avoid the redundant creation.
Comment 1 by bugdroid1@chromium.org
, Jul 16