Commit aa81ccc3 authored by John Z Wu's avatar John Z Wu Committed by Commit Bot

Refactor //ios/web_view sources into its own source_set target

- This avoids rebuilding the same sources for the framework and test.
- Created a stub implementation of ios_web_view::InitializeGlobalState
  to avoid multiple AtExitManagers in unit tests.

Change-Id: Ia1a839f2be06d8a9e2974d2e8edb9cf399e849cb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2121035
Commit-Queue: John Wu <jzw@chromium.org>
Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Reviewed-by: default avatarHiroshi Ichikawa <ichikawa@chromium.org>
Reviewed-by: default avatarEugene But <eugenebut@chromium.org>
Cr-Commit-Position: refs/heads/master@{#756028}
parent 0c490696
This diff is collapsed.
......@@ -18,11 +18,6 @@
namespace ios_web_view {
void InitializeGlobalState() {
// Do not perform global state initialization in an unit test environment.
// 1. Not needed when unit testing.
// 2. The globals below will try to create other already created globals like
// AtExitManagers. This causes DCHECKs and prevents tests from completing.
#if !defined(UNIT_TEST)
static std::unique_ptr<ios_web_view::WebViewWebClient> web_client;
static std::unique_ptr<ios_web_view::WebViewWebMainDelegate>
web_main_delegate;
......@@ -49,7 +44,6 @@ void InitializeGlobalState() {
web_client.reset();
}];
});
#endif // defined(UNIT_TEST)
}
} // namespace ios_web_view
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ios/web_view/internal/web_view_global_state_util.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
#endif
namespace ios_web_view {
void InitializeGlobalState() {
// Do not perform global state initialization in an unit test environment.
// It's not needed and also avoids the issue of multiple AtExitManagers.
}
} // namespace ios_web_view
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