Commit 2206cb50 authored by Ramin Halavati's avatar Ramin Halavati Committed by Commit Bot

Enable DeleteSoleProfile test on Linux.

On Lacros, when a browser is deleted and a new one is created, the
pointer to the new browser can be the same as the old one and this could
result in flaky failures.

Pointer inequality check is restricted to non-lacros and and a check
is added for the old and new browser profile paths.

Bug: 1130131
Change-Id: Ibf7004b126587f2341623d69c7c25775fb460018
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2442530
Commit-Queue: Ramin Halavati <rhalavati@chromium.org>
Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#815504}
parent da9586ce
......@@ -154,17 +154,13 @@ IN_PROC_BROWSER_TEST_F(ProfileHelperTest, OpenNewWindowForProfile) {
#endif
}
// Test is flaky on Lacros. crbug.com/1130131
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
#define MAYBE_DeleteSoleProfile DISABLED_DeleteSoleProfile
#else
#define MAYBE_DeleteSoleProfile DeleteSoleProfile
#endif
IN_PROC_BROWSER_TEST_F(ProfileHelperTest, MAYBE_DeleteSoleProfile) {
IN_PROC_BROWSER_TEST_F(ProfileHelperTest, DeleteSoleProfile) {
content::TestWebUI web_ui;
Browser* original_browser = browser();
ProfileAttributesStorage& storage =
g_browser_process->profile_manager()->GetProfileAttributesStorage();
base::FilePath original_browser_profile_path =
original_browser->profile()->GetPath();
BrowserList* browser_list = BrowserList::GetInstance();
EXPECT_EQ(1u, browser_list->size());
......@@ -179,8 +175,13 @@ IN_PROC_BROWSER_TEST_F(ProfileHelperTest, MAYBE_DeleteSoleProfile) {
Browser* new_browser = added_observer.Wait();
EXPECT_EQ(1u, browser_list->size());
// On Lacros, the pointer to the new browser may be the same as the old one.
// https://crbug.com/1130131
#if !defined(OS_CHROMEOS) || !defined(OS_LINUX)
EXPECT_FALSE(base::Contains(*browser_list, original_browser));
EXPECT_NE(new_browser, original_browser);
#endif
EXPECT_NE(original_browser_profile_path, new_browser->profile()->GetPath());
EXPECT_EQ(1u, storage.GetNumberOfProfiles());
}
......
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