0
Files
src/content/test/render_document_feature.h
Sharon Yang 7ce309e3d3 Add a speculative RenderViewHost to FrameTree for RenderDocument
As the RenderDocument and SiteInstance group projects converge, it's no
longer sufficient to have the RenderViewHostMap keyed with a
SiteInstanceGroup. When creating a speculative main frame
RenderFrameHost, its associated RenderViewHost may be in the same
SiteInstanceGroup as the previous document, but since it's a new
document, it should have a different RenderViewHost. This CL addresses
that by introducing a speculative RenderViewHost to FrameTree, that
behaves in a similar way to a speculative RenderFrameHost.
This CL uses the speculative RenderViewHost for same-SiteInstanceGroup
navigations. We will separately investigate using it for the
cross-SiteInstanceGroup case for consistency.
Doc: https://docs.google.com/document/d/1NSWccmWKzqIyGdh-KO6PGSCANQr2PIJ3gO4fQf82ONQ/edit?usp=sharing

Bug: 1336305
Change-Id: I0ea8510094e27e7641006625a7be9b4202c32def
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3732341
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Reviewed-by: Charlie Reis <creis@chromium.org>
Commit-Queue: Sharon Yang <yangsharon@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1094687}
2023-01-19 21:39:57 +00:00

42 lines
1.3 KiB
C++

// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CONTENT_TEST_RENDER_DOCUMENT_FEATURE_H_
#define CONTENT_TEST_RENDER_DOCUMENT_FEATURE_H_
#include <string>
#include <vector>
#include "testing/gtest/include/gtest/gtest.h"
namespace base {
namespace test {
class ScopedFeatureList;
} // namespace test
} // namespace base
namespace content {
void InitAndEnableRenderDocumentFeature(
base::test::ScopedFeatureList* feature_list,
std::string level);
// The list of values to test for the "level" parameter.
std::vector<std::string> RenderDocumentFeatureLevelValues();
// Returns a list containing only the highest level of RenderDocument enabled
// in the "level" parameter. This is useful for RenderDocument tests that expect
// to enable the mode via this parameter, even if this is the only mode being
// tested.
std::vector<std::string> RenderDocumentFeatureFullyEnabled();
// Returns the name for |render_document_level| that's valid for test params
// (only contains alphanumeric characters or underscores).
std::string GetRenderDocumentLevelNameForTestParams(
std::string render_document_level);
} // namespace content
#endif // CONTENT_TEST_RENDER_DOCUMENT_FEATURE_H_