Commit f742bcbd authored by Clark DuVall's avatar Clark DuVall Committed by Commit Bot

Add browsertest for sync call deadlock on Android

This also enables NetworkServiceRestartBrowserTests on Android, since
OOP NS is supported now.

Bug: 901026
Change-Id: If66c1fcd7d0286fd2bf545dc406e541c69fd77a8
Reviewed-on: https://chromium-review.googlesource.com/c/1313111Reviewed-by: default avatarKen Rockot <rockot@google.com>
Reviewed-by: default avatarJohn Abd-El-Malek <jam@chromium.org>
Commit-Queue: Clark DuVall <cduvall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#606069}
parent e957f458
......@@ -22,6 +22,7 @@
#include "content/public/browser/network_service_instance.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/service_names.mojom.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/content_browser_test.h"
#include "content/public/test/content_browser_test_utils.h"
......@@ -30,12 +31,15 @@
#include "content/shell/browser/shell.h"
#include "content/shell/browser/shell_browser_context.h"
#include "content/test/storage_partition_test_utils.h"
#include "mojo/public/cpp/bindings/sync_call_restrictions.h"
#include "net/dns/mock_host_resolver.h"
#include "net/test/embedded_test_server/http_request.h"
#include "net/traffic_annotation/network_traffic_annotation_test_helper.h"
#include "services/network/public/cpp/features.h"
#include "services/network/public/cpp/simple_url_loader.h"
#include "services/network/public/mojom/network_service.mojom.h"
#include "services/network/public/mojom/network_service_test.mojom.h"
#include "services/service_manager/public/cpp/connector.h"
#if BUILDFLAG(ENABLE_PLUGINS)
#include "content/public/test/ppapi_test_utils.h"
......@@ -875,8 +879,14 @@ IN_PROC_BROWSER_TEST_F(NetworkServiceRestartBrowserTest, ServiceWorkerFetch) {
service_worker_context->RemoveObserver(&observer);
}
// TODO(crbug.com/154571): Shared workers are not available on Android.
#if defined(OS_ANDROID)
#define MAYBE_SharedWorker DISABLED_SharedWorker
#else
#define MAYBE_SharedWorker SharedWorker
#endif
// Make sure shared workers terminate after crash.
IN_PROC_BROWSER_TEST_F(NetworkServiceRestartBrowserTest, SharedWorker) {
IN_PROC_BROWSER_TEST_F(NetworkServiceRestartBrowserTest, MAYBE_SharedWorker) {
StoragePartitionImpl* partition = static_cast<StoragePartitionImpl*>(
BrowserContext::GetDefaultStoragePartition(browser_context()));
......@@ -1084,4 +1094,30 @@ IN_PROC_BROWSER_TEST_F(NetworkServiceRestartBrowserTest, Plugin) {
}
#endif
// TODO(crbug.com/901026): Fix deadlock on process startup on Android.
#if defined(OS_ANDROID)
#define MAYBE_SyncCallDuringRestart DISABLED_SyncCallDuringRestart
#else
#define MAYBE_SyncCallDuringRestart SyncCallDuringRestart
#endif
IN_PROC_BROWSER_TEST_F(NetworkServiceRestartBrowserTest,
MAYBE_SyncCallDuringRestart) {
network::mojom::NetworkServiceTestPtr network_service_test;
base::RunLoop run_loop;
ServiceManagerConnection::GetForProcess()->GetConnector()->BindInterface(
mojom::kNetworkServiceName, &network_service_test);
// Crash the network service, but do not wait for full startup.
network_service_test.set_connection_error_handler(run_loop.QuitClosure());
network_service_test->SimulateCrash();
run_loop.Run();
ServiceManagerConnection::GetForProcess()->GetConnector()->BindInterface(
mojom::kNetworkServiceName, &network_service_test);
// Sync call should be fine, even though network process is still starting up.
mojo::ScopedAllowSyncCallForTesting allow_sync_call;
network_service_test->AddRules({});
}
} // namespace content
......@@ -1129,7 +1129,6 @@ test("content_browsertests") {
sources -= [
"../browser/keyboard_lock_browsertest.cc",
"../browser/media/session/audio_focus_delegate_default_browsertest.cc",
"../browser/network_service_restart_browsertest.cc",
"../browser/pointer_lock_browsertest.cc",
"../browser/pointer_lock_browsertest.h",
]
......
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