Commit 75774053 authored by Robert Liao's avatar Robert Liao Committed by Commit Bot

Revert "Re-enable TabManagerTest.DiscardTabsWithMinimizedAndOccludedWindows."

This reverts commit a79e01b5.

Reason for revert: This test fails on Mac10.13 bots

First failure:
https://ci.chromium.org/p/chromium/builders/ci/Mac10.13%20Tests%20%28dbg%29/16594

[ RUN      ] TabManagerTest.DiscardTabsWithOccludedWindow
[81401:775:0106/112821.053347:INFO:content_main_runner_impl.cc(966)] Chrome is running in full browser mode.
[81401:775:0106/112821.247127:ERROR:device.mm(28)] Failed to find MTLDevice.
[81401:48159:0106/112821.651720:WARNING:notification_platform_bridge_mac.mm(542)] AlertNotificationService: XPC connection invalidated.
[81417:775:0106/112823.114183:ERROR:device.mm(28)] Failed to find MTLDevice.
[81417:775:0106/112823.119549:ERROR:vt_video_encode_accelerator_mac.cc(517)]  VTCompressionSessionCreate failed: -12908
[81401:775:0106/112824.022443:WARNING:gaia_auth_fetcher.cc(989)] Could not reach Google Accounts servers: errno -11
[81429:775:0106/112824.262864:ERROR:runtime_enabled_features.cc(2100)] RuntimeEnabledFeature not recognized: PageLifecycle
[81428:775:0106/112824.389850:ERROR:runtime_enabled_features.cc(2100)] RuntimeEnabledFeature not recognized: PageLifecycle
[81401:775:0106/112824.920521:WARNING:gaia_auth_fetcher.cc(989)] Could not reach Google Accounts servers: errno -11
[81433:775:0106/112826.323872:ERROR:runtime_enabled_features.cc(2100)] RuntimeEnabledFeature not recognized: PageLifecycle
[81401:775:0106/112827.522912:WARNING:gaia_auth_fetcher.cc(989)] Could not reach Google Accounts servers: errno -102
[81401:775:0106/112836.042665:WARNING:gaia_auth_fetcher.cc(989)] Could not reach Google Accounts servers: errno -102
../../content/public/test/browser_test_base.cc:622: Failure
Failed
RunLoop::Run() timed out.
Stack trace:
0   libbase.dylib                       0x00000001390da89d base::debug::StackTrace::StackTrace(unsigned long) + 29
1   libbase.dylib                       0x00000001390da878 base::debug::StackTrace::StackTrace() + 40
2   browser_tests                       0x0000000104a1df56 StackTraceGetter::CurrentStackTrace(int, int) + 134
3   browser_tests                       0x0000000104a2eb03 testing::internal::UnitTestImpl::CurrentOsStackTraceExceptTop(int) + 83
4   browser_tests                       0x0000000104a2e53a testing::internal::AssertHelper::operator=(testing::Message const&) const + 154
5   browser_tests                       0x0000000107c38bbe _ZZN4base25MakeExpectedNotRunClosureERKNS_8LocationENS_16BasicStringPieceINSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEEEENK3$_0clES2_SB_ + 126
6   browser_tests                       0x0000000107c38b16 _ZN4base8internal13FunctorTraitsIZNS_25MakeExpectedNotRunClosureERKNS_8LocationENS_16BasicStringPieceINSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEEEE3$_0vE6InvokeIRKSE_JS4_RKSC_EEEvOT_DpOT0_ + 102
7   browser_tests                       0x0000000107c38a37 _ZN4base8internal12InvokeHelperILb0EvE8MakeItSoIRKZNS_25MakeExpectedNotRunClosureERKNS_8LocationENS_16BasicStringPieceINSt3__112basic_stringIcNS8_11char_traitsIcEENS8_9allocatorIcEEEEEEE3$_0JS6_RKSE_EEEvOT_DpOT0_ + 71
8   browser_tests                       0x0000000107c389e3 _ZN4base8internal7InvokerINS0_9BindStateIZNS_25MakeExpectedNotRunClosureERKNS_8LocationENS_16BasicStringPieceINSt3__112basic_stringIcNS7_11char_traitsIcEENS7_9allocatorIcEEEEEEE3$_0JS3_SD_EEEFvvEE7RunImplIRKSF_RKNS7_5tupleIJS3_SD_EEEJLm0ELm1EEEEvOT_OT0_NS7_16integer_sequenceImJXspT1_EEEE + 99
9   browser_tests                       0x0000000107c38972 _ZN4base8internal7InvokerINS0_9BindStateIZNS_25MakeExpectedNotRunClosureERKNS_8LocationENS_16BasicStringPieceINSt3__112basic_stringIcNS7_11char_traitsIcEENS7_9allocatorIcEEEEEEE3$_0JS3_SD_EEEFvvEE3RunEPNS0_13BindStateBaseE + 66
10  libbase.dylib                       0x00000001390887a5 base::OnceCallback<void ()>::Run() && + 117

Original change's description:
> Re-enable TabManagerTest.DiscardTabsWithMinimizedAndOccludedWindows.
> 
> The crash stack on the bug is in non-TabManager code. Let's see if
> the test passes when re-enabled.
> 
> This CL also:
> - Splits the test in 2 tests to avoid timing out (local tests show
>   that we can time out when having too many navigations in the same
>   test).
> - On ChromeOS, allows discarding of the active tab in the last focused
>   browser window if that window is not visible. Previously, the active
>   tab in the last focused browser window was not discardable, even if
>   the window was not visible.
> 
> Bug: 772839
> Change-Id: I18552a16361c8beb4d48409227b727a40cc40ec7
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1972570
> Commit-Queue: Chris Hamilton <chrisha@chromium.org>
> Auto-Submit: François Doray <fdoray@chromium.org>
> Reviewed-by: Chris Hamilton <chrisha@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#728572}

TBR=chrisha@chromium.org,fdoray@chromium.org

Change-Id: I0bf70f2be84485c7ffca7f4e2e015e5038eb0a9b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 772839
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1986693Reviewed-by: default avatarRobert Liao <robliao@chromium.org>
Commit-Queue: Robert Liao <robliao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#728749}
parent fdc7253d
......@@ -1043,15 +1043,6 @@ void TabLifecycleUnitSource::TabLifecycleUnit::DidStartLoading() {
void TabLifecycleUnitSource::TabLifecycleUnit::OnVisibilityChanged(
content::Visibility visibility) {
// Ensure that the tab is not considered focused when not visible.
//
// TabLifeycleUnitSource calls SetFocused(false) when focus changes to another
// tab. The code below is also required to cover the case where the focused
// tab is hidden but no other tab is focused, which can happen when the
// focused window is minimized or occluded.
if (visibility != content::Visibility::VISIBLE)
SetFocused(false);
OnLifecycleUnitVisibilityChanged(visibility);
}
......
......@@ -1490,66 +1490,71 @@ Browser* CreateBrowserWithTabs(int num_tabs) {
} // namespace
IN_PROC_BROWSER_TEST_F(TabManagerTest, DiscardTabsWithMinimizedWindow) {
// Minimized browser.
EnsureTabsInBrowser(browser(), 2);
browser()->window()->Minimize();
// Other browser that will be last active. This browser exists because the
// last active tab cannot be discarded on
// Advance time so everything is urgent discardable.
test_clock_.Advance(kBackgroundUrgentProtectionTime);
for (int i = 0; i < 2; ++i)
tab_manager()->DiscardTab(LifecycleUnitDiscardReason::URGENT);
base::RunLoop().RunUntilIdle();
// On ChromeOS, active tabs are discarded if their window is non-visible. On
// other platforms, they are never discarded.
#if defined(OS_CHROMEOS)
EXPECT_TRUE(
IsTabDiscarded(browser()->tab_strip_model()->GetWebContentsAt(0)));
// Flaky on Linux. Times out on Windows and Mac debug builds.
// http://crbug.com/772839.
#if defined(OS_LINUX) || \
((defined(OS_WIN) || defined(OS_MACOSX)) && !defined(NDEBUG))
#define MAYBE_DiscardTabsWithMinimizedAndOccludedWindows \
DISABLED_DiscardTabsWithMinimizedAndOccludedWindows
#else
EXPECT_FALSE(
IsTabDiscarded(browser()->tab_strip_model()->GetWebContentsAt(0)));
#define MAYBE_DiscardTabsWithMinimizedAndOccludedWindows \
DiscardTabsWithMinimizedAndOccludedWindows
#endif
// Non-active tabs can be discarded on all platforms.
EXPECT_TRUE(
IsTabDiscarded(browser()->tab_strip_model()->GetWebContentsAt(1)));
}
IN_PROC_BROWSER_TEST_F(TabManagerTest, DiscardTabsWithOccludedWindow) {
// Occluded browser.
EnsureTabsInBrowser(browser(), 2);
browser()->window()->SetBounds(gfx::Rect(10, 10, 10, 10));
// Other browser that covers the occluded browser.
Browser* other_browser = CreateBrowserWithTabs(1);
EXPECT_NE(other_browser, browser());
other_browser->window()->SetBounds(gfx::Rect(0, 0, 100, 100));
IN_PROC_BROWSER_TEST_F(TabManagerTest,
MAYBE_DiscardTabsWithMinimizedAndOccludedWindows) {
// Covered by |browser2|.
Browser* browser1 = browser();
EnsureTabsInBrowser(browser1, 2);
browser1->window()->SetBounds(gfx::Rect(10, 10, 10, 10));
// Covers |browser1|.
Browser* browser2 = CreateBrowserWithTabs(2);
EXPECT_NE(browser1, browser2);
browser2->window()->SetBounds(gfx::Rect(0, 0, 100, 100));
// Active browser.
Browser* browser3 = CreateBrowserWithTabs(2);
EXPECT_NE(browser1, browser3);
EXPECT_NE(browser2, browser3);
browser3->window()->SetBounds(gfx::Rect(110, 0, 100, 100));
// Minimized browser.
Browser* browser4 = CreateBrowserWithTabs(2);
browser4->window()->Minimize();
EXPECT_NE(browser1, browser4);
EXPECT_NE(browser2, browser4);
EXPECT_NE(browser3, browser4);
// Advance time so everything is urgent discardable.
test_clock_.Advance(kBackgroundUrgentProtectionTime);
for (int i = 0; i < 3; ++i)
tab_manager()->DiscardTab(LifecycleUnitDiscardReason::URGENT);
for (int i = 0; i < 8; ++i)
tab_manager()->DiscardTab(LifecycleUnitDiscardReason::PROACTIVE);
base::RunLoop().RunUntilIdle();
// On ChromeOS, active tabs are discarded if their window is non-visible. On
// other platforms, they are never discarded.
#if defined(OS_CHROMEOS)
EXPECT_TRUE(
IsTabDiscarded(browser()->tab_strip_model()->GetWebContentsAt(0)));
EXPECT_TRUE(IsTabDiscarded(browser1->tab_strip_model()->GetWebContentsAt(0)));
EXPECT_FALSE(
IsTabDiscarded(browser2->tab_strip_model()->GetWebContentsAt(0)));
EXPECT_FALSE(
IsTabDiscarded(browser3->tab_strip_model()->GetWebContentsAt(0)));
EXPECT_TRUE(IsTabDiscarded(browser4->tab_strip_model()->GetWebContentsAt(0)));
#else
EXPECT_FALSE(
IsTabDiscarded(browser()->tab_strip_model()->GetWebContentsAt(0)));
IsTabDiscarded(browser1->tab_strip_model()->GetWebContentsAt(0)));
EXPECT_FALSE(
IsTabDiscarded(browser2->tab_strip_model()->GetWebContentsAt(0)));
EXPECT_FALSE(
IsTabDiscarded(browser3->tab_strip_model()->GetWebContentsAt(0)));
EXPECT_FALSE(
IsTabDiscarded(browser4->tab_strip_model()->GetWebContentsAt(0)));
#endif
// Non-active tabs can be discarded on all platforms.
EXPECT_TRUE(
IsTabDiscarded(browser()->tab_strip_model()->GetWebContentsAt(1)));
EXPECT_TRUE(IsTabDiscarded(browser1->tab_strip_model()->GetWebContentsAt(1)));
EXPECT_TRUE(IsTabDiscarded(browser2->tab_strip_model()->GetWebContentsAt(1)));
EXPECT_TRUE(IsTabDiscarded(browser3->tab_strip_model()->GetWebContentsAt(1)));
EXPECT_TRUE(IsTabDiscarded(browser4->tab_strip_model()->GetWebContentsAt(1)));
}
IN_PROC_BROWSER_TEST_F(TabManagerTest, UnfreezeTabOnNavigationEvent) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment