[Cleanup] Avoid content::ConsoleObserverDelegate in doodle browsertests
Avoid using content::ConsoleObserverDelegate in LocalNTPDoodleTests. Instead, use: - content::WebContentsConsoleObserver, when we're awaiting a specific message. - A new helper class, FailOnConsoleMessage, when the console observer was only used to record all console messages and fail whenever one was present. This allows us to avoid overriding the existing WebContentsDelegate, if any (which can mask behavior unintentional changes, and also required extra code to set the original delegate *back* in some scenarios). Additionally, correct cases where the console observer was monitoring for messages (presumably for failure), but never checking the result. FailOnConsoleMessage automatically adds a failure when a console message is received, rather than needing to explicitly check for one. Bug: 1034150 Change-Id: I161ba6256bdcd8db6b2d65d5cc0b345874db5727 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1980959Reviewed-by:Dan Beam <dbeam@chromium.org> Commit-Queue: Devlin <rdevlin.cronin@chromium.org> Cr-Commit-Position: refs/heads/master@{#727585}
Showing
This diff is collapsed.
Please register or sign in to comment