Commit f8e92a3c authored by Ken Rockot's avatar Ken Rockot Committed by Commit Bot

Re-enable ServiceManagerContextTest.TerminateOnServiceQuit

This was disabled on Chrome OS + ASAN due to flakiness.

I suspect the flakiness is caused by use of fork() in a
multithreaded environment, via base::GetAppOutputAndError.

This CL changes the offending test to not use the
ContentBrowserTest fixture and instead simply call
base::GetAppOutputAndError from a single-threaded unit
test. The manually launched browser test in the launched
subprocess remains unchanged.

Renames the browser test fixture to
ServiceManagerContentBrowserTest to disambiguate from the
new non-browser-test test case.

Bug: 803188
Change-Id: I5d1be42cb35ccc6ec79ed1cbda83018291aecaa2

TBR=jam

Change-Id: I5d1be42cb35ccc6ec79ed1cbda83018291aecaa2
Reviewed-on: https://chromium-review.googlesource.com/875269
Commit-Queue: Ken Rockot <rockot@chromium.org>
Reviewed-by: default avatarJames Cook <jamescook@chromium.org>
Cr-Commit-Position: refs/heads/master@{#530377}
parent 06a3d332
...@@ -91,10 +91,10 @@ class ServiceInstanceListener ...@@ -91,10 +91,10 @@ class ServiceInstanceListener
} // namespace } // namespace
using ServiceManagerContextTest = ContentBrowserTest; using ServiceManagerContextBrowserTest = ContentBrowserTest;
// "MANUAL" tests only run when kRunManualTestsFlag is set. // "MANUAL" tests only run when kRunManualTestsFlag is set.
IN_PROC_BROWSER_TEST_F(ServiceManagerContextTest, IN_PROC_BROWSER_TEST_F(ServiceManagerContextBrowserTest,
MANUAL_TerminateOnServiceQuit) { MANUAL_TerminateOnServiceQuit) {
ShellContentBrowserClient::Get() ShellContentBrowserClient::Get()
->set_should_terminate_on_service_quit_callback( ->set_should_terminate_on_service_quit_callback(
...@@ -112,21 +112,14 @@ IN_PROC_BROWSER_TEST_F(ServiceManagerContextTest, ...@@ -112,21 +112,14 @@ IN_PROC_BROWSER_TEST_F(ServiceManagerContextTest,
loop.Run(); loop.Run();
} }
// Flaky on Chromium OS ASAN: http://crbug.com/803188
#if defined(OS_CHROMEOS) && defined(ADDRESS_SANITIZER)
#define MAYBE_TerminateOnServiceQuit DISABLED_TerminateOnServiceQuit
#else
#define MAYBE_TerminateOnServiceQuit TerminateOnServiceQuit
#endif
// Verifies that if an important service quits then the browser exits. // Verifies that if an important service quits then the browser exits.
IN_PROC_BROWSER_TEST_F(ServiceManagerContextTest, TEST(ServiceManagerContextTest, TerminateOnServiceQuit) {
MAYBE_TerminateOnServiceQuit) {
// Run the above test and collect the test output. // Run the above test and collect the test output.
base::CommandLine new_test = base::CommandLine new_test =
base::CommandLine(base::CommandLine::ForCurrentProcess()->GetProgram()); base::CommandLine(base::CommandLine::ForCurrentProcess()->GetProgram());
new_test.AppendSwitchASCII( new_test.AppendSwitchASCII(
base::kGTestFilterFlag, base::kGTestFilterFlag,
"ServiceManagerContextTest.MANUAL_TerminateOnServiceQuit"); "ServiceManagerContextBrowserTest.MANUAL_TerminateOnServiceQuit");
new_test.AppendSwitch(kRunManualTestsFlag); new_test.AppendSwitch(kRunManualTestsFlag);
new_test.AppendSwitch(kSingleProcessTestsFlag); new_test.AppendSwitch(kSingleProcessTestsFlag);
...@@ -142,7 +135,8 @@ IN_PROC_BROWSER_TEST_F(ServiceManagerContextTest, ...@@ -142,7 +135,8 @@ IN_PROC_BROWSER_TEST_F(ServiceManagerContextTest,
#endif #endif
} }
IN_PROC_BROWSER_TEST_F(ServiceManagerContextTest, ServiceProcessReportsPID) { IN_PROC_BROWSER_TEST_F(ServiceManagerContextBrowserTest,
ServiceProcessReportsPID) {
service_manager::mojom::ServiceManagerListenerPtr listener_proxy; service_manager::mojom::ServiceManagerListenerPtr listener_proxy;
ServiceInstanceListener listener(mojo::MakeRequest(&listener_proxy)); ServiceInstanceListener listener(mojo::MakeRequest(&listener_proxy));
......
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