0

Perform OCR on PDF images and add the recognized text to them.

Send images inside PDFs to ScreenAI service's OCR module and write the
recognized text over the images with invisible ink to make PDF text
interactable.
This approach will replace the existing approach to make inaccessible
PDFs readable for assistive technologies.

This CL is created based on a prototype by thestig@.

AX-Relnotes: n/a
Bug: 360803943
Change-Id: I37e373685e7f3fc2f7c6ff1bf41417af18edc056
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5739036
Commit-Queue: Ramin Halavati <rhalavati@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1361604}
This commit is contained in:
Ramin Halavati
2024-09-29 16:23:02 +00:00
committed by Chromium LUCI CQ
parent a4d6f3fed6
commit ba34114d17
12 changed files with 195 additions and 53 deletions

@ -210,7 +210,14 @@ void PdfOcrController::OnAccessibilityStatusEvent(
#endif // BUIDLFLAG(IS_CHROMEOS_ASH)
void PdfOcrController::OnActivationChanged() {
bool enable = IsAccessibilityEnabled(profile_);
// PDF Searchify feature performs OCR on all inaccessible PDFs regardless of
// accessibility settings. Therefore if it is enabled, we don't need to enable
// OCR in PDF viewer.
// TODO(crbug.com/360803943): Remove this class when PDF Searchify is
// launched.
bool enable =
(!base::FeatureList::IsEnabled(chrome_pdf::features::kPdfSearchify) &&
IsAccessibilityEnabled(profile_));
if (enable == IsEnabled()) {
return; // No change in activation.

@ -1336,16 +1336,17 @@ INSTANTIATE_FEATURE_OVERRIDE_TEST_SUITE(
class PdfOcrIntegrationTest
: public PDFExtensionAccessibilityTest,
public screen_ai::ScreenAIInstallState::Observer,
public ::testing::WithParamInterface<std::tuple<bool, bool, bool>> {
public ::testing::WithParamInterface<std::tuple<bool, bool, bool, bool>> {
public:
PdfOcrIntegrationTest() = default;
~PdfOcrIntegrationTest() override = default;
bool IsOcrServiceEnabled() const { return std::get<0>(GetParam()); }
bool IsLibraryAvailable() const { return std::get<1>(GetParam()); }
bool IsSearchifyEnabled() const { return std::get<2>(GetParam()); }
// PDFExtensionAccessibilityTest:
bool UseOopif() const override { return std::get<2>(GetParam()); }
bool UseOopif() const override { return std::get<3>(GetParam()); }
bool IsOcrAvailable() const {
return IsOcrServiceEnabled() && IsLibraryAvailable();
@ -1395,6 +1396,20 @@ class PdfOcrIntegrationTest
}
}
int GetExpectedStatus(bool has_content) {
// TODO(crbug.com/360803943): Update `PdfAccessibilityTree` to send the same
// notifications when searchify is enabled.
if (IsSearchifyEnabled()) {
return IDS_PDF_LOADED_TO_A11Y_TREE;
}
if (!IsOcrAvailable()) {
return IDS_PDF_OCR_FEATURE_ALERT;
}
return has_content ? IDS_PDF_OCR_COMPLETED : IDS_PDF_OCR_NO_RESULT;
}
protected:
std::vector<base::test::FeatureRefAndParams> GetEnabledFeatures()
const override {
@ -1404,6 +1419,9 @@ class PdfOcrIntegrationTest
if (IsOcrServiceEnabled()) {
enabled.push_back({ax::mojom::features::kScreenAIOCREnabled, {}});
}
if (IsSearchifyEnabled()) {
enabled.push_back({chrome_pdf::features::kPdfSearchify, {}});
}
if (UseOopif()) {
enabled.push_back({chrome_pdf::features::kPdfOopif, {}});
}
@ -1418,6 +1436,9 @@ class PdfOcrIntegrationTest
if (!IsOcrServiceEnabled()) {
disabled.push_back(ax::mojom::features::kScreenAIOCREnabled);
}
if (!IsSearchifyEnabled()) {
disabled.push_back(chrome_pdf::features::kPdfSearchify);
}
if (!UseOopif()) {
disabled.push_back(chrome_pdf::features::kPdfOopif);
}
@ -1444,6 +1465,13 @@ class PdfOcrIntegrationTest
GetExpectedAXTreeDumpForPdf(test_pdf_path, IsOcrAvailable());
ASSERT_NE("", expected_tree_dump);
// TODO(crbug.com/360803943): Update `PdfAccessibilityTree` to add header
// and footer to the searchify extracted text, similar to the enabled OCR
// case.
if (IsSearchifyEnabled()) {
return;
}
ASSERT_MULTILINE_STREQ(expected_tree_dump, ax_tree_dump);
}
@ -1529,39 +1557,39 @@ IN_PROC_BROWSER_TEST_P(PdfOcrIntegrationTest, EnsureScreenAIInitializes) {
}
IN_PROC_BROWSER_TEST_P(PdfOcrIntegrationTest, HelloWorld) {
RunPDFAXTreeDumpTest(
"hello-world-in-image.pdf",
IsOcrAvailable() ? IDS_PDF_OCR_COMPLETED : IDS_PDF_OCR_FEATURE_ALERT);
RunPDFAXTreeDumpTest("hello-world-in-image.pdf",
GetExpectedStatus(/*has_content=*/true));
}
IN_PROC_BROWSER_TEST_P(PdfOcrIntegrationTest, ThreePagePDF) {
RunPDFAXTreeDumpTest(
"inaccessible-text-in-three-page.pdf",
IsOcrAvailable() ? IDS_PDF_OCR_COMPLETED : IDS_PDF_OCR_FEATURE_ALERT);
RunPDFAXTreeDumpTest("inaccessible-text-in-three-page.pdf",
GetExpectedStatus(/*has_content=*/true));
}
IN_PROC_BROWSER_TEST_P(PdfOcrIntegrationTest, TestBatchingWithTwentyPagePDF) {
RunPDFAXTreeDumpTest(
"inaccessible-text-in-twenty-page.pdf",
IsOcrAvailable() ? IDS_PDF_OCR_COMPLETED : IDS_PDF_OCR_FEATURE_ALERT);
RunPDFAXTreeDumpTest("inaccessible-text-in-twenty-page.pdf",
GetExpectedStatus(/*has_content=*/true));
}
IN_PROC_BROWSER_TEST_P(PdfOcrIntegrationTest, NoOcrResultOnBlankImagePdf) {
RunPDFAXTreeDumpTest("blank_image.pdf", IsOcrAvailable()
? IDS_PDF_OCR_NO_RESULT
: IDS_PDF_OCR_FEATURE_ALERT);
RunPDFAXTreeDumpTest("blank_image.pdf",
GetExpectedStatus(/*has_content=*/false));
}
INSTANTIATE_TEST_SUITE_P(
All,
PdfOcrIntegrationTest,
::testing::Combine(testing::Bool(), testing::Bool(), testing::Bool()),
[](const testing::TestParamInfo<std::tuple<bool, bool, bool>>& info) {
::testing::Combine(testing::Bool(),
testing::Bool(),
testing::Bool(),
testing::Bool()),
[](const testing::TestParamInfo<std::tuple<bool, bool, bool, bool>>& info) {
return base::StringPrintf(
"OCR_%s_Library_%s_%s",
"OcrService_%s_Library_%s_Searchify_%s_%s",
std::get<0>(info.param) ? "Enabled" : "Disabled",
std::get<1>(info.param) ? "Available" : "Unavailable",
std::get<2>(info.param) ? "OOPIF" : "GuestView");
std::get<2>(info.param) ? "Enabled" : "Disabled",
std::get<3>(info.param) ? "OOPIF" : "GuestView");
});
#endif // defined(PDF_OCR_INTEGRATION_TEST_ENABLED)

@ -30,6 +30,7 @@
#include "content/public/renderer/render_frame.h"
#include "content/public/renderer/render_thread.h"
#include "pdf/pdf_accessibility_action_handler.h"
#include "pdf/pdf_features.h"
#include "third_party/blink/public/web/web_element.h"
#include "third_party/blink/public/web/web_local_frame.h"
#include "third_party/blink/public/web/web_plugin_container.h"
@ -243,6 +244,13 @@ gfx::Transform MakeTransformForImage(const gfx::RectF image_screen_size,
#endif // BUILDFLAG(ENABLE_SCREEN_AI_SERVICE)
// When PDF Searchify is enabled, inaccessible PDFs are made accessible in
// PDFium by sending their images to the OCR service and adding the recognized
// text to the PDF. Hence they don't need extra work here.
bool PdfOcrInRenderer() {
return features::IsPdfOcrEnabled() &&
!base::FeatureList::IsEnabled(chrome_pdf::features::kPdfSearchify);
}
} // namespace
PdfAccessibilityTree::PdfAccessibilityTree(
@ -576,7 +584,7 @@ void PdfAccessibilityTree::DoSetAccessibilityPageInfo(
#if BUILDFLAG(ENABLE_SCREEN_AI_SERVICE)
// TODO(crbug.com/40267312): Use a more explicit flag indicating whether any
// image was sent to the OCR model in `AddRemainingAnnotations()`.
if (features::IsPdfOcrEnabled() && !did_get_a_text_run_ && has_image) {
if (PdfOcrInRenderer() && !did_get_a_text_run_ && has_image) {
if (ocr_helper_) {
// Notify users via the status node that PDF OCR is about to run since
// the AXMode was set for PDF OCR.
@ -592,8 +600,7 @@ void PdfAccessibilityTree::DoSetAccessibilityPageInfo(
#endif // BUILDFLAG(ENABLE_SCREEN_AI_SERVICE)
if (page_index == page_count_ - 1) {
if (!features::IsPdfOcrEnabled() || did_get_a_text_run_ ||
!did_have_an_image_) {
if (!PdfOcrInRenderer() || did_get_a_text_run_ || !did_have_an_image_) {
// In this case, PDF OCR doesn't run. Thus, set the status node to notify
// users that the PDF content has been loaded into an accessibility tree.
SetStatusMessage(IDS_PDF_LOADED_TO_A11Y_TREE);
@ -684,7 +691,7 @@ void PdfAccessibilityTree::UnserializeNodes() {
#if BUILDFLAG(ENABLE_SCREEN_AI_SERVICE)
// TODO(crbug.com/40070182): Update this and other cases with a
// `IsAccessiblePDF` function.
if (features::IsPdfOcrEnabled() && !did_get_a_text_run_) {
if (PdfOcrInRenderer() && !did_get_a_text_run_) {
base::UmaHistogramBoolean(
"Accessibility.PdfOcr.ActiveWhenInaccessiblePdfOpened",
ocr_helper_ != nullptr);

@ -16,6 +16,7 @@
#include "content/public/renderer/v8_value_converter.h"
#include "net/cookies/site_for_cookies.h"
#include "printing/buildflags/buildflags.h"
#include "third_party/blink/public/platform/browser_interface_broker_proxy.h"
#include "third_party/blink/public/platform/scheduler/web_agent_group_scheduler.h"
#include "third_party/blink/public/platform/web_security_origin.h"
#include "third_party/blink/public/platform/web_string.h"
@ -32,6 +33,7 @@
#include "third_party/blink/public/web/web_serialized_script_value.h"
#include "third_party/blink/public/web/web_view.h"
#include "third_party/blink/public/web/web_widget.h"
#include "ui/accessibility/ax_features.mojom-features.h"
#include "ui/display/screen_info.h"
#include "ui/gfx/geometry/point_f.h"
#include "ui/gfx/geometry/rect.h"
@ -197,6 +199,35 @@ PdfViewWebPluginClient::CreateAssociatedURLLoader(
return GetFrame()->CreateAssociatedURLLoader(options);
}
void PdfViewWebPluginClient::PerformOcr(
const SkBitmap& image,
base::OnceCallback<void(screen_ai::mojom::VisualAnnotationPtr)> callback) {
CHECK(base::FeatureList::IsEnabled(ax::mojom::features::kScreenAIOCREnabled));
if (!screen_ai_annotator_.is_bound()) {
render_frame_->GetBrowserInterfaceBroker().GetInterface(
screen_ai_annotator_.BindNewPipeAndPassReceiver());
screen_ai_annotator_->SetClientType(
screen_ai::mojom::OcrClientType::kPdfViewer);
screen_ai_annotator_.set_disconnect_handler(
base::BindOnce(&PdfViewWebPluginClient::OnOcrDisconnected,
weak_factory_.GetWeakPtr()));
}
screen_ai_annotator_->PerformOcrAndReturnAnnotation(image,
std::move(callback));
}
void PdfViewWebPluginClient::SetOcrDisconnectedCallback(
base::RepeatingClosure callback) {
ocr_disconnect_callback_ = std::move(callback);
}
void PdfViewWebPluginClient::OnOcrDisconnected() {
screen_ai_annotator_.reset();
CHECK(ocr_disconnect_callback_);
ocr_disconnect_callback_.Run();
}
void PdfViewWebPluginClient::UpdateTextInputState() {
// `widget` is null in Print Preview.
auto* widget = GetFrame()->FrameWidget();

@ -7,9 +7,12 @@
#include <memory>
#include "base/functional/callback.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/weak_ptr.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "pdf/pdf_view_web_plugin.h"
#include "services/screen_ai/public/mojom/screen_ai_service.mojom.h"
namespace blink {
class WebLocalFrame;
@ -84,10 +87,17 @@ class PdfViewWebPluginClient : public chrome_pdf::PdfViewWebPlugin::Client {
chrome_pdf::PdfAccessibilityImageFetcher* image_fetcher,
blink::WebPluginContainer* plugin_element,
bool print_preview) override;
void PerformOcr(
const SkBitmap& image,
base::OnceCallback<void(screen_ai::mojom::VisualAnnotationPtr)> callback)
override;
void SetOcrDisconnectedCallback(base::RepeatingClosure callback) override;
private:
blink::WebLocalFrame* GetFrame() const;
void OnOcrDisconnected();
const raw_ptr<content::RenderFrame> render_frame_;
const std::unique_ptr<content::V8ValueConverter> v8_value_converter_;
@ -95,6 +105,9 @@ class PdfViewWebPluginClient : public chrome_pdf::PdfViewWebPlugin::Client {
raw_ptr<blink::WebPluginContainer> plugin_container_;
mojo::Remote<screen_ai::mojom::ScreenAIAnnotator> screen_ai_annotator_;
base::RepeatingClosure ocr_disconnect_callback_;
base::WeakPtrFactory<PdfViewWebPluginClient> weak_factory_{this};
};

@ -348,6 +348,7 @@ if (enable_pdf) {
"//pdf/loader",
"//printing",
"//services/network/public/mojom:url_loader_base",
"//services/screen_ai/buildflags",
"//skia",
"//third_party/blink/public:blink_headers",
"//third_party/blink/public/common:headers",

@ -8,6 +8,7 @@
#include <utility>
#include <vector>
#include "base/check_op.h"
#include "base/numerics/safe_math.h"
#include "pdf/accessibility_helper.h"
#include "pdf/accessibility_structs.h"
@ -30,15 +31,15 @@ AccessibilityFormFieldInfo GetAccessibilityFormFieldInfo(
} // namespace
bool GetAccessibilityInfo(PDFiumEngine* engine,
void GetAccessibilityInfo(PDFiumEngine* engine,
int32_t page_index,
AccessibilityPageInfo& page_info,
std::vector<AccessibilityTextRunInfo>& text_runs,
std::vector<AccessibilityCharInfo>& chars,
AccessibilityPageObjects& page_objects) {
int page_count = engine->GetNumberOfPages();
if (page_index < 0 || page_index >= page_count)
return false;
CHECK_GE(page_index, 0);
CHECK_LT(page_index, page_count);
int char_count = engine->GetCharCount(page_index);
@ -115,7 +116,6 @@ bool GetAccessibilityInfo(PDFiumEngine* engine,
page_objects.highlights = engine->GetHighlightInfo(page_index, text_runs);
page_objects.form_fields = GetAccessibilityFormFieldInfo(
engine, page_index, page_info.text_run_count);
return true;
}
} // namespace chrome_pdf

@ -18,10 +18,9 @@ struct AccessibilityPageObjects;
struct AccessibilityTextRunInfo;
// Retrieve `page_info`, `text_runs`, `chars`, and `page_objects` from
// `engine` for the page at 0-indexed `page_index`. Returns true on success with
// all out parameters filled, or false on failure with all out parameters
// untouched.
bool GetAccessibilityInfo(PDFiumEngine* engine,
// `engine` for the page at 0-indexed `page_index`.
// Expects the `page_index` to be valid.
void GetAccessibilityInfo(PDFiumEngine* engine,
int32_t page_index,
AccessibilityPageInfo& page_info,
std::vector<AccessibilityTextRunInfo>& text_runs,

@ -1204,6 +1204,12 @@ void PdfViewWebPlugin::DocumentLoadComplete() {
if (accessibility_state_ == AccessibilityState::kPending)
LoadAccessibility();
// To avoid delaying page load for searchify, start searchify after document
// load is completed.
client_->SetOcrDisconnectedCallback(engine_->GetOcrDisconnectHandler());
engine_->StartSearchify(
base::BindRepeating(&Client::PerformOcr, client_->GetWeakPtr()));
if (!full_frame_)
return;
@ -2621,9 +2627,26 @@ AccessibilityDocInfo PdfViewWebPlugin::GetAccessibilityDocInfo() const {
}
void PdfViewWebPlugin::PrepareAndSetAccessibilityPageInfo(int32_t page_index) {
// Outdated calls are ignored.
if (page_index != next_accessibility_page_index_)
// Ignore outdated or out of range calls.
if (page_index != next_accessibility_page_index_ || page_index < 0 ||
page_index >= engine_->GetNumberOfPages()) {
return;
}
// Wait for the page to be loaded and searchified before getting accessibility
// page info.
// Ensure page is loaded so that it can schedule a searchify operation if
// needed.
engine_->GetPage(page_index)->GetPage();
if (engine_->PageNeedsSearchify(page_index)) {
base::SingleThreadTaskRunner::GetCurrentDefault()->PostDelayedTask(
FROM_HERE,
base::BindOnce(&PdfViewWebPlugin::PrepareAndSetAccessibilityPageInfo,
weak_factory_.GetWeakPtr(), page_index),
kAccessibilityPageDelay * 10);
return;
}
++next_accessibility_page_index_;
AccessibilityPageInfo page_info;
@ -2631,21 +2654,21 @@ void PdfViewWebPlugin::PrepareAndSetAccessibilityPageInfo(int32_t page_index) {
std::vector<AccessibilityCharInfo> chars;
AccessibilityPageObjects page_objects;
if (!GetAccessibilityInfo(engine_.get(), page_index, page_info, text_runs,
chars, page_objects)) {
return;
}
GetAccessibilityInfo(engine_.get(), page_index, page_info, text_runs, chars,
page_objects);
pdf_accessibility_data_handler_->SetAccessibilityPageInfo(
std::move(page_info), std::move(text_runs), std::move(chars),
std::move(page_objects));
// Schedule loading the next page.
base::SingleThreadTaskRunner::GetCurrentDefault()->PostDelayedTask(
FROM_HERE,
base::BindOnce(&PdfViewWebPlugin::PrepareAndSetAccessibilityPageInfo,
weak_factory_.GetWeakPtr(), page_index + 1),
kAccessibilityPageDelay);
// Schedule loading the next page if there's more.
if (page_index + 1 < engine_->GetNumberOfPages()) {
base::SingleThreadTaskRunner::GetCurrentDefault()->PostDelayedTask(
FROM_HERE,
base::BindOnce(&PdfViewWebPlugin::PrepareAndSetAccessibilityPageInfo,
weak_factory_.GetWeakPtr(), page_index + 1),
kAccessibilityPageDelay);
}
}
void PdfViewWebPlugin::PrepareAndSetAccessibilityViewportInfo() {

@ -34,6 +34,7 @@
#include "pdf/post_message_receiver.h"
#include "pdf/preview_mode_client.h"
#include "pdf/v8_value_converter.h"
#include "services/screen_ai/buildflags/buildflags.h"
#include "third_party/blink/public/platform/web_string.h"
#include "third_party/blink/public/platform/web_text_input_type.h"
#include "third_party/blink/public/web/web_plugin.h"
@ -53,6 +54,10 @@
#include "pdf/pdf_ink_module_client.h"
#endif
#if BUILDFLAG(ENABLE_SCREEN_AI_SERVICE)
#include "services/screen_ai/public/mojom/screen_ai_service.mojom-forward.h"
#endif
namespace blink {
class WebAssociatedURLLoader;
class WebInputEvent;
@ -241,6 +246,20 @@ class PdfViewWebPlugin final : public PDFiumEngineClient,
PdfAccessibilityImageFetcher* image_fetcher,
blink::WebPluginContainer* plugin_container,
bool print_preview);
#if BUILDFLAG(ENABLE_SCREEN_AI_SERVICE)
// Performs OCR on `image` and sends the recognized text to `callback`.
// In case OCR service gets disconnected before or during running this
// request, `callback` will not be called.
virtual void PerformOcr(
const SkBitmap& image,
base::OnceCallback<void(screen_ai::mojom::VisualAnnotationPtr)>
callback) = 0;
// Sets a `callback` that is notified if OCR service gets disconnected.
virtual void SetOcrDisconnectedCallback(
base::RepeatingClosure callback) = 0;
#endif
};
PdfViewWebPlugin(std::unique_ptr<Client> client,

@ -45,6 +45,7 @@
#include "pdf/test/test_pdfium_engine.h"
#include "printing/metafile_skia.h"
#include "services/network/public/mojom/referrer_policy.mojom-shared.h"
#include "services/screen_ai/buildflags/buildflags.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/input/web_coalesced_input_event.h"
@ -317,6 +318,19 @@ class FakePdfViewWebPluginClient : public PdfViewWebPlugin::Client {
blink::WebPluginContainer*,
bool),
(override));
#if BUILDFLAG(ENABLE_SCREEN_AI_SERVICE)
MOCK_METHOD(void,
PerformOcr,
(const SkBitmap& image,
base::OnceCallback<void(screen_ai::mojom::VisualAnnotationPtr)>
callback),
(override));
MOCK_METHOD(void,
SetOcrDisconnectedCallback,
(base::RepeatingClosure callback),
(override));
#endif // BUILDFLAG(ENABLE_SCREEN_AI_SERVICE)
};
class FakePdfHost : public pdf::mojom::PdfHost {

@ -84,8 +84,8 @@ TEST_P(AccessibilityTest, GetAccessibilityPage) {
std::vector<AccessibilityTextRunInfo> text_runs;
std::vector<AccessibilityCharInfo> chars;
AccessibilityPageObjects page_objects;
ASSERT_TRUE(GetAccessibilityInfo(engine.get(), 0, page_info, text_runs, chars,
page_objects));
GetAccessibilityInfo(engine.get(), 0, page_info, text_runs, chars,
page_objects);
EXPECT_EQ(0u, page_info.page_index);
EXPECT_EQ(gfx::Rect(5, 3, 266, 266), page_info.bounds);
EXPECT_EQ(text_runs.size(), page_info.text_run_count);
@ -133,8 +133,8 @@ TEST_P(AccessibilityTest, GetAccessibilityImageInfo) {
std::vector<AccessibilityTextRunInfo> text_runs;
std::vector<AccessibilityCharInfo> chars;
AccessibilityPageObjects page_objects;
ASSERT_TRUE(GetAccessibilityInfo(engine.get(), 0, page_info, text_runs, chars,
page_objects));
GetAccessibilityInfo(engine.get(), 0, page_info, text_runs, chars,
page_objects);
EXPECT_EQ(0u, page_info.page_index);
EXPECT_EQ(gfx::Rect(5, 3, 816, 1056), page_info.bounds);
EXPECT_EQ(text_runs.size(), page_info.text_run_count);
@ -451,8 +451,8 @@ TEST_P(AccessibilityTest, GetAccessibilityLinkInfo) {
std::vector<AccessibilityTextRunInfo> text_runs;
std::vector<AccessibilityCharInfo> chars;
AccessibilityPageObjects page_objects;
ASSERT_TRUE(GetAccessibilityInfo(engine.get(), 0, page_info, text_runs, chars,
page_objects));
GetAccessibilityInfo(engine.get(), 0, page_info, text_runs, chars,
page_objects);
EXPECT_EQ(0u, page_info.page_index);
EXPECT_EQ(gfx::Rect(5, 3, 533, 266), page_info.bounds);
EXPECT_EQ(text_runs.size(), page_info.text_run_count);
@ -490,8 +490,8 @@ TEST_P(AccessibilityTest, GetAccessibilityHighlightInfo) {
std::vector<AccessibilityTextRunInfo> text_runs;
std::vector<AccessibilityCharInfo> chars;
AccessibilityPageObjects page_objects;
ASSERT_TRUE(GetAccessibilityInfo(engine.get(), 0, page_info, text_runs, chars,
page_objects));
GetAccessibilityInfo(engine.get(), 0, page_info, text_runs, chars,
page_objects);
EXPECT_EQ(0u, page_info.page_index);
EXPECT_EQ(gfx::Rect(5, 3, 533, 266), page_info.bounds);
EXPECT_EQ(text_runs.size(), page_info.text_run_count);
@ -537,8 +537,8 @@ TEST_P(AccessibilityTest, GetAccessibilityTextFieldInfo) {
std::vector<AccessibilityTextRunInfo> text_runs;
std::vector<AccessibilityCharInfo> chars;
AccessibilityPageObjects page_objects;
ASSERT_TRUE(GetAccessibilityInfo(engine.get(), 0, page_info, text_runs, chars,
page_objects));
GetAccessibilityInfo(engine.get(), 0, page_info, text_runs, chars,
page_objects);
EXPECT_EQ(0u, page_info.page_index);
EXPECT_EQ(gfx::Rect(5, 3, 400, 400), page_info.bounds);
EXPECT_EQ(text_runs.size(), page_info.text_run_count);