Fire NOTIFICATION_EXTENSION_HOST_CREATED at most once per ExtensionHost.
Tests assume that NOTIFICATION_EXTENSION_HOST_CREATED fires at most once (see BrowserActionInteractiveTest::TearDownOnMainThread which compares the number of "created" vs "destroyed" notifications). This assumption has not been met by the product code, which would fire NOTIFICATION_EXTENSION_HOST_CREATED for every RenderViewReady notification which happens not only for the very first RenderViewHost, but also for possible subsequent RenderViewHost swaps (e.g. when navigating cross-site). This CL fixes ExtensionHost::RenderViewReady, to ensure that the NOTIFICATION_EXTENSION_HOST_CREATED fires at most once per ExtensionHost object. Note that NOTIFICATION_EXTENSION_HOST_CREATED is only listened to by test code (browser_action_interactive_test.cc and management_api_browsertest.cc). This means that this CL should have no effect on production code and product behavior. Fixed: 1066287 Change-Id: I30b26294c9edb18420b7d3d4b8d560c360914a06 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2129230 Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org> Reviewed-by:Karan Bhatia <karandeepb@chromium.org> Cr-Commit-Position: refs/heads/master@{#755504}
Showing
Please register or sign in to comment