diff --git a/browser/ui/views/split_view/split_view.cc b/browser/ui/views/split_view/split_view.cc index 3b519155b563..62c3d0c0e37f 100644 --- a/browser/ui/views/split_view/split_view.cc +++ b/browser/ui/views/split_view/split_view.cc @@ -208,14 +208,12 @@ void SplitView::OnTileTabs(const TabTile& tile) { UpdateContentsWebViewVisual(); } -void SplitView::OnWillBreakTile(const TabTile& tile) { +void SplitView::OnDidBreakTile(const TabTile& tile) { if (!IsActiveWebContentsTiled(tile)) { return; } - base::SequencedTaskRunner::GetCurrentDefault()->PostTask( - FROM_HERE, base::BindOnce(&SplitView::UpdateContentsWebViewVisual, - weak_ptr_factory_.GetWeakPtr())); + UpdateContentsWebViewVisual(); } void SplitView::OnSwapTabsInTile(const TabTile& tile) { diff --git a/browser/ui/views/split_view/split_view.h b/browser/ui/views/split_view/split_view.h index c52790a08c79..5a3b3e5b5a1a 100644 --- a/browser/ui/views/split_view/split_view.h +++ b/browser/ui/views/split_view/split_view.h @@ -95,7 +95,7 @@ class SplitView : public views::View, public SplitViewBrowserDataObserver { // SplitViewBrowserDataObserver: void OnTileTabs(const TabTile& tile) override; - void OnWillBreakTile(const TabTile& tile) override; + void OnDidBreakTile(const TabTile& tile) override; void OnSwapTabsInTile(const TabTile& tile) override; private: diff --git a/browser/ui/views/split_view/split_view_browsertest.cc b/browser/ui/views/split_view/split_view_browsertest.cc index bacecc8c312a..f6f1a1dafb73 100644 --- a/browser/ui/views/split_view/split_view_browsertest.cc +++ b/browser/ui/views/split_view/split_view_browsertest.cc @@ -113,8 +113,7 @@ IN_PROC_BROWSER_TEST_F(SplitViewBrowserTest, split_view_data->IsTabTiled(tab_strip_model().GetTabHandleAt(0))); // Then, the secondary web view should become hidden - ASSERT_TRUE(base::test::RunUntil( - [&]() { return !secondary_contents_container().GetVisible(); })); + EXPECT_FALSE(secondary_contents_container().GetVisible()); } IN_PROC_BROWSER_TEST_F(SplitViewBrowserTest,