Commit 3431fc62 authored by Chong Zhang's avatar Chong Zhang Committed by Commit Bot

NetworkService: Cache network_context_request_ in TestingProfile

This patch affects tests only.

We want to cache the |network_context_request_| to avoid triggering
connection error handler infinitely.

(Also organized unrelated BackgroundFetchBrowserTest.* tests)

Bug: 889965
Change-Id: I9fc67b03f19b8a9575db7714ea57ec41fc0a7711
Reviewed-on: https://chromium-review.googlesource.com/1249727
Commit-Queue: Chong Zhang <chongz@chromium.org>
Reviewed-by: default avatarMatt Menke <mmenke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#594946}
parent 689a69cd
......@@ -1014,7 +1014,7 @@ network::mojom::NetworkContextPtr TestingProfile::CreateNetworkContext(
const base::FilePath& relative_partition_path) {
if (base::FeatureList::IsEnabled(network::features::kNetworkService)) {
network::mojom::NetworkContextPtr network_context;
mojo::MakeRequest(&network_context);
network_context_request_ = mojo::MakeRequest(&network_context);
return network_context;
}
return nullptr;
......
......@@ -19,6 +19,7 @@
#include "components/domain_reliability/clear_mode.h"
#include "components/keyed_service/content/browser_context_keyed_service_factory.h"
#include "extensions/buildflags/buildflags.h"
#include "services/network/public/mojom/network_context.mojom.h"
#include "services/network/public/mojom/network_service.mojom.h"
#if defined(OS_CHROMEOS)
......@@ -404,6 +405,10 @@ class TestingProfile : public Profile {
// request context. Currently, only the CookieMonster is hooked up.
scoped_refptr<net::URLRequestContextGetter> extensions_request_context_;
// Holds a dummy network context request to avoid triggering connection error
// handler.
network::mojom::NetworkContextRequest network_context_request_;
bool force_incognito_;
std::unique_ptr<Profile> incognito_profile_;
TestingProfile* original_profile_;
......
......@@ -14,12 +14,6 @@
-ArcSessionManagerTest.ManagedAndroidAccount
-ArcSessionManagerTest.ManagedChromeAccount
-ArcSessionManagerTest.WellKnownConsumerAccount
-BackgroundFetchBrowserTest.FetchesRunToCompletionAndUpdateTitle_Failed
-BackgroundFetchBrowserTest.FetchesRunToCompletionAndUpdateTitle_Fetched
-BackgroundFetchBrowserTest.FetchFromChildFrameWithPermissions
-BackgroundFetchBrowserTest.FetchFromServiceWorker
-BackgroundFetchBrowserTest.OfflineItemCollection_VerifyResourceDownloadedWhenDownloadTotalLargerThanActualSize
-BackgroundFetchBrowserTest.OfflineItemCollection_VerifyResourceDownloadedWhenDownloadTotalSmallerThanActualSize
-CheckSystemTokenAvailability/EnterprisePlatformKeysTest.Basic/0
-CheckSystemTokenAvailability/EnterprisePlatformKeysTest.Basic/1
-CheckSystemTokenAvailability/EnterprisePlatformKeysTest.Basic/2
......@@ -31,9 +25,6 @@
-DeviceIDTest.Migration
-DeviceIDTest.NewUsers
-ExtensionWebRequestApiTest.WebRequestApiDoesNotCrashOnErrorAfterProfileDestroyed
-FileManagerPrivateApiTest.OnFileChanged
-FileManagerPrivateApiTest.Permissions
-FileManagerUITest.QuickView
-ForceMaximizeOnFirstRunTest.TwoRuns
-ForceMaximizePolicyFalseTest.GeneralFirstRun
-HostedAppNonClientFrameViewAshTest.FocusableViews/material
......@@ -134,11 +125,12 @@
# https://crbug.com/882610
-ChromeBrowserMainBrowserTest.VariationsServiceStartsRequestOnNetworkChange
-NetworkConnectionTrackerBrowserTest.SimulateNetworkServiceCrash
# Time out in StoragePartitionImpl::InitNetworkContext(). Might be related to
# https://crbug.com/882610
-ArcAuthServiceChildAccountTest.ChildTransition
-FileManagerPrivateApiTest.OnFileChanged
-BackgroundFetchBrowserTest.FetchesRunToCompletionAndUpdateTitle_Failed
-BackgroundFetchBrowserTest.FetchesRunToCompletionAndUpdateTitle_Fetched
-BackgroundFetchBrowserTest.FetchFromChildFrameWithPermissions
-BackgroundFetchBrowserTest.FetchFromServiceWorker
-BackgroundFetchBrowserTest.OfflineItemCollection_VerifyResourceDownloadedWhenDownloadTotalLargerThanActualSize
-BackgroundFetchBrowserTest.OfflineItemCollection_VerifyResourceDownloadedWhenDownloadTotalSmallerThanActualSize
# Relies on net::URLRequestInterceptor.
# https://crbug.com/884782
......
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