Fix a browser test broken by Answer Card.
AppListControllerSearchResultsBrowserTest.UninstallSearchResult is broken by the Answer Card feature randomly. It happens when the AnswerCardSearchProvider object is GCed before DidFinishNavigation is called. Then the navigation context becomes nullptr and will break the equal check with the content source. This commit skips those late DidFinishNavigation calls by unsetting the delegates when AnswerCardWebContents objects get recycled. Crash logs: [ RUN ] AppListControllerSearchResultsBrowserTest.UninstallSearchResult [10573:10573:0922/200830.460519:FATAL:answer_card_search_provider.cc(131)] Check failed: source == context_for_loading.contents.get() (0x15fd7b449f30 vs. (nil)) #0 0x00000387062c base::debug::StackTrace::StackTrace() #1 0x00000388999c logging::LogMessage::~LogMessage() #2 0x0000067d8611 app_list::AnswerCardSearchProvider::DidFinishNavigation() #3 0x0000067d9a85 app_list::AnswerCardWebContents::DidFinishNavigation() #4 0x00000267cb07 content::WebContentsImpl::DidFinishNavigation() #5 0x000002375fb9 content::NavigationHandleImpl::~NavigationHandleImpl() #6 0x00000237663e content::NavigationHandleImpl::~NavigationHandleImpl() #7 0x00000266ad3c content::WebContentsImpl::~WebContentsImpl() #8 0x00000266bade content::WebContentsImpl::~WebContentsImpl() #9 0x0000067d91e3 app_list::AnswerCardWebContents::~AnswerCardWebContents() #10 0x0000067d7ecd app_list::AnswerCardSearchProvider::~AnswerCardSearchProvider() #11 0x0000067d7f2e app_list::AnswerCardSearchProvider::~AnswerCardSearchProvider() #12 0x000008b3e28b app_list::SearchController::~SearchController() ... Bug: 766784 Change-Id: Iaa5da44696c567815626d24d8bad5436cb971f27 Reviewed-on: https://chromium-review.googlesource.com/682756Reviewed-by:Vadim Tryshev <vadimt@chromium.org> Reviewed-by:
Xiyuan Xia <xiyuan@chromium.org> Commit-Queue: Jiaquan He <hejq@google.com> Cr-Commit-Position: refs/heads/master@{#504202}
Showing
Please register or sign in to comment