Commit 565fc1c8 authored by K. Moon's avatar K. Moon Committed by Commit Bot

Add PDF partial loading study to testing config

Adds a new study to the field trial testing config to experiment with
disabling PDF partial loading. PDF loading fails under certain
circumstances, and disabling these features should help.

The feature switches were added previously in crrev.com/c/2349429 and
crrev.com/c/2352217. Note that the PdfPartialLoading feature requires
the PdfIncrementalLoading feature, since it relies on PDFium to issue
requests for additional segments of the PDF.

Fixed the ChromeFindRequestManagerTest.FindInChunkedPDF browser test to
enable the partial loading features explicitly.

Bug: 1115149
Change-Id: I3aa5333c088687d5b299459335a386e4b889b55a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2387436
Commit-Queue: K. Moon <kmoon@chromium.org>
Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
Reviewed-by: default avatarJesse Doherty <jwd@chromium.org>
Reviewed-by: default avatarDaniel Hosseinian <dhoss@chromium.org>
Cr-Commit-Position: refs/heads/master@{#805766}
parent f785e652
......@@ -7,6 +7,7 @@
#include "base/path_service.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/scoped_feature_list.h"
#include "base/threading/thread_restrictions.h"
#include "build/build_config.h"
#include "chrome/browser/pdf/pdf_extension_test_util.h"
......@@ -27,6 +28,7 @@
#include "net/dns/mock_host_resolver.h"
#include "net/test/embedded_test_server/controllable_http_response.h"
#include "pdf/document_loader_impl.h"
#include "pdf/pdf_features.h"
#include "third_party/blink/public/mojom/frame/find_in_page.mojom.h"
namespace content {
......@@ -90,6 +92,20 @@ class ChromeFindRequestManagerTest : public InProcessBrowserTest {
DISALLOW_COPY_AND_ASSIGN(ChromeFindRequestManagerTest);
};
class ChromeFindRequestManagerTestWithPdfPartialLoading
: public ChromeFindRequestManagerTest {
public:
ChromeFindRequestManagerTestWithPdfPartialLoading() {
feature_list_.InitWithFeatures(
{chrome_pdf::features::kPdfIncrementalLoading,
chrome_pdf::features::kPdfPartialLoading},
{});
}
private:
base::test::ScopedFeatureList feature_list_;
};
// Tests searching in a full-page PDF.
// Flaky on Windows ASAN: crbug.com/1030368.
#if defined(OS_WIN) && defined(ADDRESS_SANITIZER)
......@@ -157,7 +173,8 @@ void SendRangeResponse(net::test_server::ControllableHttpResponse* response,
// Tests searching in a PDF received in chunks via range-requests. See also
// https://crbug.com/1027173.
IN_PROC_BROWSER_TEST_F(ChromeFindRequestManagerTest, FindInChunkedPDF) {
IN_PROC_BROWSER_TEST_F(ChromeFindRequestManagerTestWithPdfPartialLoading,
FindInChunkedPDF) {
constexpr uint32_t kStalledResponseSize =
chrome_pdf::DocumentLoaderImpl::kDefaultRequestSize + 123;
......
......@@ -773,6 +773,7 @@ if (!is_android) {
"//mojo/public/cpp/system",
"//net",
"//net:test_support",
"//pdf:features",
"//ppapi/buildflags",
"//printing/buildflags",
"//rlz/buildflags",
......
......@@ -4888,6 +4888,41 @@
]
}
],
"PdfPartialLoading": [
{
"platforms": [
"chromeos",
"linux",
"mac",
"windows"
],
"experiments": [
{
"name": "Disabled",
"disable_features": [
"PdfIncrementalLoading",
"PdfPartialLoading"
]
},
{
"name": "IncrementalOnly",
"enable_features": [
"PdfIncrementalLoading"
],
"disable_features": [
"PdfPartialLoading"
]
},
{
"name": "Enabled",
"enable_features": [
"PdfIncrementalLoading",
"PdfPartialLoading"
]
}
]
}
],
"PerProcessReclaim": [
{
"platforms": [
......
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