diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-29 10:46:47 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-11-02 12:02:10 +0000 |
commit | 99677208ff3b216fdfec551fbe548da5520cd6fb (patch) | |
tree | 476a4865c10320249360e859d8fdd3e01833b03a /chromium/headless | |
parent | c30a6232df03e1efbd9f3b226777b07e087a1122 (diff) | |
download | qtwebengine-chromium-99677208ff3b216fdfec551fbe548da5520cd6fb.tar.gz |
BASELINE: Update Chromium to 86.0.4240.124
Change-Id: Ide0ff151e94cd665ae6521a446995d34a9d1d644
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/headless')
26 files changed, 235 insertions, 98 deletions
diff --git a/chromium/headless/BUILD.gn b/chromium/headless/BUILD.gn index 0ca66f77943..2e59c319fa3 100644 --- a/chromium/headless/BUILD.gn +++ b/chromium/headless/BUILD.gn @@ -474,7 +474,7 @@ component("headless_non_renderer") { if (is_mac) { deps += [ ":mac_helpers" ] - libs = [ + frameworks = [ "AppKit.framework", "CoreFoundation.framework", ] @@ -617,12 +617,16 @@ test("headless_browsertests") { "test/headless_browser_test.cc", "test/headless_browser_test.h", "test/headless_client_browsertest.cc", - "test/headless_protocol_browsertest.cc", "test/headless_test_launcher.cc", "test/test_network_interceptor.cc", "test/test_network_interceptor.h", ] + # TODO(https://crbug.com/1107396): These tests flakily timeout on fuchsia. + if (!is_fuchsia) { + sources += [ "test/headless_protocol_browsertest.cc" ] + } + data = [ "lib/dom_tree_extraction_expected_nodes.txt", "lib/dom_tree_extraction_expected_styles.txt", diff --git a/chromium/headless/DEPS b/chromium/headless/DEPS index 51e7ce530af..376faeaa51f 100644 --- a/chromium/headless/DEPS +++ b/chromium/headless/DEPS @@ -23,9 +23,9 @@ include_rules = [ "+ui/gfx/geometry", "+ui/gl", "+ui/ozone/public", + "+sandbox/policy", "+sandbox/win/src", "+services/network/public", "+services/service_manager/embedder", "+services/service_manager/public", - "+services/service_manager/sandbox", ] diff --git a/chromium/headless/app/headless_shell.cc b/chromium/headless/app/headless_shell.cc index fc17e3f310c..6b5120b05eb 100644 --- a/chromium/headless/app/headless_shell.cc +++ b/chromium/headless/app/headless_shell.cc @@ -56,7 +56,7 @@ #include "sandbox/win/src/sandbox_types.h" #endif -#if defined(OS_MACOSX) +#if defined(OS_MAC) #include "components/os_crypt/os_crypt_switches.h" #endif @@ -676,7 +676,7 @@ int HeadlessShellMain(int argc, const char** argv) { builder.SetCrashDumpsDir(dumps_path); #endif -#if defined(OS_MACOSX) +#if defined(OS_MAC) command_line.AppendSwitch(os_crypt::switches::kUseMockKeychain); #endif diff --git a/chromium/headless/app/headless_shell_main.cc b/chromium/headless/app/headless_shell_main.cc index 4dc6c8aed42..79b2ba95b13 100644 --- a/chromium/headless/app/headless_shell_main.cc +++ b/chromium/headless/app/headless_shell_main.cc @@ -8,7 +8,7 @@ #if defined(OS_WIN) #include "content/public/app/sandbox_helper_win.h" #include "sandbox/win/src/sandbox_types.h" -#elif defined(OS_MACOSX) +#elif defined(OS_MAC) #include "base/check.h" #include "sandbox/mac/seatbelt_exec.h" #endif @@ -19,14 +19,14 @@ int main(int argc, const char** argv) { content::InitializeSandboxInfo(&sandbox_info); return headless::HeadlessShellMain(0, &sandbox_info); #else -#if defined(OS_MACOSX) +#if defined(OS_MAC) sandbox::SeatbeltExecServer::CreateFromArgumentsResult seatbelt = sandbox::SeatbeltExecServer::CreateFromArguments( argv[0], argc, const_cast<char**>(argv)); if (seatbelt.sandbox_required) { CHECK(seatbelt.server->InitializeSandbox()); } -#endif // defined(OS_MACOSX) +#endif // defined(OS_MAC) return headless::HeadlessShellMain(argc, argv); #endif // defined(OS_WIN) diff --git a/chromium/headless/app/headless_shell_switches.cc b/chromium/headless/app/headless_shell_switches.cc index 7dca1731189..cace234a5db 100644 --- a/chromium/headless/app/headless_shell_switches.cc +++ b/chromium/headless/app/headless_shell_switches.cc @@ -119,8 +119,8 @@ const char kVirtualTimeBudget[] = "virtual-time-budget"; // Sets the initial window size. Provided as string in the format "800,600". const char kWindowSize[] = "window-size"; -// Whitelist for Negotitate Auth servers. -const char kAuthServerWhitelist[] = "auth-server-whitelist"; +// Allowlist for Negotiate Auth servers. +const char kAuthServerAllowlist[] = "auth-server-whitelist"; // Sets font render hinting when running headless, affects Skia rendering and // whether glyph subpixel positioning is enabled. diff --git a/chromium/headless/app/headless_shell_switches.h b/chromium/headless/app/headless_shell_switches.h index b4575689e1c..27e3c5b5a9c 100644 --- a/chromium/headless/app/headless_shell_switches.h +++ b/chromium/headless/app/headless_shell_switches.h @@ -37,7 +37,7 @@ HEADLESS_EXPORT extern const char kUserAgent[]; HEADLESS_EXPORT extern const char kUserDataDir[]; HEADLESS_EXPORT extern const char kVirtualTimeBudget[]; HEADLESS_EXPORT extern const char kWindowSize[]; -HEADLESS_EXPORT extern const char kAuthServerWhitelist[]; +HEADLESS_EXPORT extern const char kAuthServerAllowlist[]; HEADLESS_EXPORT extern const char kFontRenderHinting[]; HEADLESS_EXPORT extern const char kBlockNewWebContents[]; diff --git a/chromium/headless/lib/browser/headless_browser_impl_mac.mm b/chromium/headless/lib/browser/headless_browser_impl_mac.mm index 3757c0e971a..4c42eb8283b 100644 --- a/chromium/headless/lib/browser/headless_browser_impl_mac.mm +++ b/chromium/headless/lib/browser/headless_browser_impl_mac.mm @@ -6,6 +6,7 @@ #import "base/mac/scoped_objc_class_swizzler.h" #include "base/no_destructor.h" +#include "content/public/browser/render_widget_host_view.h" #include "content/public/browser/web_contents.h" #include "headless/lib/browser/headless_web_contents_impl.h" #import "ui/base/cocoa/base_view.h" @@ -90,6 +91,11 @@ void HeadlessBrowserImpl::PlatformSetWebContentsBounds( web_contents->web_contents()->GetNativeView().GetNativeNSView(); NSRect frame = gfx::ScreenRectToNSRect(bounds); [web_view setFrame:frame]; + + content::RenderWidgetHostView* host_view = + web_contents->web_contents()->GetRenderWidgetHostView(); + if (host_view) + host_view->SetWindowFrameInScreen(bounds); } ui::Compositor* HeadlessBrowserImpl::PlatformGetCompositor( diff --git a/chromium/headless/lib/browser/headless_browser_main_parts.h b/chromium/headless/lib/browser/headless_browser_main_parts.h index 49432387df6..1bc219297de 100644 --- a/chromium/headless/lib/browser/headless_browser_main_parts.h +++ b/chromium/headless/lib/browser/headless_browser_main_parts.h @@ -29,10 +29,10 @@ class HeadlessBrowserMainParts : public content::BrowserMainParts { void PreDefaultMainMessageLoopRun(base::OnceClosure quit_closure) override; bool MainMessageLoopRun(int* result_code) override; void PostMainMessageLoopRun() override; -#if defined(OS_MACOSX) +#if defined(OS_MAC) void PreMainMessageLoopStart() override; #endif -#if defined(OS_LINUX) +#if defined(OS_LINUX) || defined(OS_CHROMEOS) void PostMainMessageLoopStart() override; #endif void QuitMainMessageLoop(); diff --git a/chromium/headless/lib/browser/headless_clipboard.cc b/chromium/headless/lib/browser/headless_clipboard.cc index dd1daa3f4e2..603f28d276b 100644 --- a/chromium/headless/lib/browser/headless_clipboard.cc +++ b/chromium/headless/lib/browser/headless_clipboard.cc @@ -8,6 +8,7 @@ #include "base/numerics/safe_conversions.h" #include "base/strings/utf_string_conversions.h" #include "ui/base/clipboard/clipboard_constants.h" +#include "ui/base/clipboard/clipboard_data_endpoint.h" namespace headless { @@ -23,8 +24,17 @@ uint64_t HeadlessClipboard::GetSequenceNumber( return GetStore(buffer).sequence_number; } -bool HeadlessClipboard::IsFormatAvailable(const ui::ClipboardFormatType& format, - ui::ClipboardBuffer buffer) const { +void HeadlessClipboard::SetClipboardDlpController( + std::unique_ptr<ui::ClipboardDlpController> dlp_controller) { + NOTIMPLEMENTED(); +} + +// |data_dst| is not used. It's only passed to be consistent with other +// platforms. +bool HeadlessClipboard::IsFormatAvailable( + const ui::ClipboardFormatType& format, + ui::ClipboardBuffer buffer, + const ui::ClipboardDataEndpoint* data_dst) const { return base::Contains(GetStore(buffer).data, format); } @@ -32,26 +42,36 @@ void HeadlessClipboard::Clear(ui::ClipboardBuffer buffer) { GetStore(buffer).Clear(); } +// |data_dst| is not used. It's only passed to be consistent with other +// platforms. void HeadlessClipboard::ReadAvailableTypes( ui::ClipboardBuffer buffer, + const ui::ClipboardDataEndpoint* data_dst, std::vector<base::string16>* types) const { DCHECK(types); types->clear(); - if (IsFormatAvailable(ui::ClipboardFormatType::GetPlainTextType(), buffer)) + if (IsFormatAvailable(ui::ClipboardFormatType::GetPlainTextType(), buffer, + data_dst)) types->push_back(base::UTF8ToUTF16(ui::kMimeTypeText)); - if (IsFormatAvailable(ui::ClipboardFormatType::GetHtmlType(), buffer)) + if (IsFormatAvailable(ui::ClipboardFormatType::GetHtmlType(), buffer, + data_dst)) types->push_back(base::UTF8ToUTF16(ui::kMimeTypeHTML)); - if (IsFormatAvailable(ui::ClipboardFormatType::GetRtfType(), buffer)) + if (IsFormatAvailable(ui::ClipboardFormatType::GetRtfType(), buffer, + data_dst)) types->push_back(base::UTF8ToUTF16(ui::kMimeTypeRTF)); - if (IsFormatAvailable(ui::ClipboardFormatType::GetBitmapType(), buffer)) + if (IsFormatAvailable(ui::ClipboardFormatType::GetBitmapType(), buffer, + data_dst)) types->push_back(base::UTF8ToUTF16(ui::kMimeTypePNG)); } +// |data_dst| is not used. It's only passed to be consistent with other +// platforms. std::vector<base::string16> HeadlessClipboard::ReadAvailablePlatformSpecificFormatNames( - ui::ClipboardBuffer buffer) const { + ui::ClipboardBuffer buffer, + const ui::ClipboardDataEndpoint* data_dst) const { const auto& data = GetStore(buffer).data; std::vector<base::string16> types; types.reserve(data.size()); @@ -63,14 +83,20 @@ HeadlessClipboard::ReadAvailablePlatformSpecificFormatNames( return types; } +// |data_dst| is not used. It's only passed to be consistent with other +// platforms. void HeadlessClipboard::ReadText(ui::ClipboardBuffer buffer, + const ui::ClipboardDataEndpoint* data_dst, base::string16* result) const { std::string result8; - ReadAsciiText(buffer, &result8); + ReadAsciiText(buffer, data_dst, &result8); *result = base::UTF8ToUTF16(result8); } +// |data_dst| is not used. It's only passed to be consistent with other +// platforms. void HeadlessClipboard::ReadAsciiText(ui::ClipboardBuffer buffer, + const ui::ClipboardDataEndpoint* data_dst, std::string* result) const { result->clear(); const DataStore& store = GetStore(buffer); @@ -79,7 +105,10 @@ void HeadlessClipboard::ReadAsciiText(ui::ClipboardBuffer buffer, *result = it->second; } +// |data_dst| is not used. It's only passed to be consistent with other +// platforms. void HeadlessClipboard::ReadHTML(ui::ClipboardBuffer buffer, + const ui::ClipboardDataEndpoint* data_dst, base::string16* markup, std::string* src_url, uint32_t* fragment_start, @@ -95,7 +124,10 @@ void HeadlessClipboard::ReadHTML(ui::ClipboardBuffer buffer, *fragment_end = base::checked_cast<uint32_t>(markup->size()); } +// |data_dst| is not used. It's only passed to be consistent with other +// platforms. void HeadlessClipboard::ReadRTF(ui::ClipboardBuffer buffer, + const ui::ClipboardDataEndpoint* data_dst, std::string* result) const { result->clear(); const DataStore& store = GetStore(buffer); @@ -104,16 +136,26 @@ void HeadlessClipboard::ReadRTF(ui::ClipboardBuffer buffer, *result = it->second; } +// |data_dst| is not used. It's only passed to be consistent with other +// platforms. void HeadlessClipboard::ReadImage(ui::ClipboardBuffer buffer, + const ui::ClipboardDataEndpoint* data_dst, ReadImageCallback callback) const { std::move(callback).Run(GetStore(buffer).image); } -void HeadlessClipboard::ReadCustomData(ui::ClipboardBuffer clipboard_buffer, - const base::string16& type, - base::string16* result) const {} - -void HeadlessClipboard::ReadBookmark(base::string16* title, +// |data_dst| is not used. It's only passed to be consistent with other +// platforms. +void HeadlessClipboard::ReadCustomData( + ui::ClipboardBuffer clipboard_buffer, + const base::string16& type, + const ui::ClipboardDataEndpoint* data_dst, + base::string16* result) const {} + +// |data_dst| is not used. It's only passed to be consistent with other +// platforms. +void HeadlessClipboard::ReadBookmark(const ui::ClipboardDataEndpoint* data_dst, + base::string16* title, std::string* url) const { const DataStore& store = GetDefaultStore(); auto it = store.data.find(ui::ClipboardFormatType::GetUrlType()); @@ -122,7 +164,10 @@ void HeadlessClipboard::ReadBookmark(base::string16* title, *title = base::UTF8ToUTF16(store.url_title); } +// |data_dst| is not used. It's only passed to be consistent with other +// platforms. void HeadlessClipboard::ReadData(const ui::ClipboardFormatType& format, + const ui::ClipboardDataEndpoint* data_dst, std::string* result) const { result->clear(); const DataStore& store = GetDefaultStore(); @@ -131,8 +176,18 @@ void HeadlessClipboard::ReadData(const ui::ClipboardFormatType& format, *result = it->second; } -void HeadlessClipboard::WritePortableRepresentations(ui::ClipboardBuffer buffer, - const ObjectMap& objects) { +#if defined(USE_OZONE) +bool HeadlessClipboard::IsSelectionBufferAvailable() const { + return false; +} +#endif // defined(USE_OZONE) + +// |data_src| is not used. It's only passed to be consistent with other +// platforms. +void HeadlessClipboard::WritePortableRepresentations( + ui::ClipboardBuffer buffer, + const ObjectMap& objects, + std::unique_ptr<ui::ClipboardDataEndpoint> data_src) { Clear(buffer); default_store_buffer_ = buffer; for (const auto& kv : objects) @@ -140,9 +195,12 @@ void HeadlessClipboard::WritePortableRepresentations(ui::ClipboardBuffer buffer, default_store_buffer_ = ui::ClipboardBuffer::kCopyPaste; } +// |data_src| is not used. It's only passed to be consistent with other +// platforms. void HeadlessClipboard::WritePlatformRepresentations( ui::ClipboardBuffer buffer, - std::vector<Clipboard::PlatformRepresentation> platform_representations) { + std::vector<Clipboard::PlatformRepresentation> platform_representations, + std::unique_ptr<ui::ClipboardDataEndpoint> data_src) { Clear(buffer); default_store_buffer_ = buffer; DispatchPlatformRepresentations(std::move(platform_representations)); diff --git a/chromium/headless/lib/browser/headless_clipboard.h b/chromium/headless/lib/browser/headless_clipboard.h index f43c8fa390d..20bbf7bcecf 100644 --- a/chromium/headless/lib/browser/headless_clipboard.h +++ b/chromium/headless/lib/browser/headless_clipboard.h @@ -13,6 +13,7 @@ #include "base/macros.h" #include "third_party/skia/include/core/SkBitmap.h" #include "ui/base/clipboard/clipboard.h" +#include "ui/base/clipboard/clipboard_data_endpoint.h" namespace headless { @@ -25,37 +26,58 @@ class HeadlessClipboard : public ui::Clipboard { // Clipboard overrides. void OnPreShutdown() override; uint64_t GetSequenceNumber(ui::ClipboardBuffer buffer) const override; - bool IsFormatAvailable(const ui::ClipboardFormatType& format, - ui::ClipboardBuffer buffer) const override; + void SetClipboardDlpController( + std::unique_ptr<ui::ClipboardDlpController> dlp_controller) override; + bool IsFormatAvailable( + const ui::ClipboardFormatType& format, + ui::ClipboardBuffer buffer, + const ui::ClipboardDataEndpoint* data_dst) const override; void Clear(ui::ClipboardBuffer buffer) override; void ReadAvailableTypes(ui::ClipboardBuffer buffer, + const ui::ClipboardDataEndpoint* data_dst, std::vector<base::string16>* types) const override; std::vector<base::string16> ReadAvailablePlatformSpecificFormatNames( - ui::ClipboardBuffer buffer) const override; + ui::ClipboardBuffer buffer, + const ui::ClipboardDataEndpoint* data_dst) const override; void ReadText(ui::ClipboardBuffer buffer, + const ui::ClipboardDataEndpoint* data_dst, base::string16* result) const override; void ReadAsciiText(ui::ClipboardBuffer buffer, + const ui::ClipboardDataEndpoint* data_dst, std::string* result) const override; void ReadHTML(ui::ClipboardBuffer buffer, + const ui::ClipboardDataEndpoint* data_dst, base::string16* markup, std::string* src_url, uint32_t* fragment_start, uint32_t* fragment_end) const override; - void ReadRTF(ui::ClipboardBuffer buffer, std::string* result) const override; + void ReadRTF(ui::ClipboardBuffer buffer, + const ui::ClipboardDataEndpoint* data_dst, + std::string* result) const override; void ReadImage(ui::ClipboardBuffer buffer, + const ui::ClipboardDataEndpoint* data_dst, ReadImageCallback callback) const override; void ReadCustomData(ui::ClipboardBuffer clipboard_buffer, const base::string16& type, + const ui::ClipboardDataEndpoint* data_dst, base::string16* result) const override; - void ReadBookmark(base::string16* title, std::string* url) const override; + void ReadBookmark(const ui::ClipboardDataEndpoint* data_dst, + base::string16* title, + std::string* url) const override; void ReadData(const ui::ClipboardFormatType& format, + const ui::ClipboardDataEndpoint* data_dst, std::string* result) const override; - void WritePortableRepresentations(ui::ClipboardBuffer buffer, - const ObjectMap& objects) override; +#if defined(USE_OZONE) + bool IsSelectionBufferAvailable() const override; +#endif // defined(USE_OZONE) + void WritePortableRepresentations( + ui::ClipboardBuffer buffer, + const ObjectMap& objects, + std::unique_ptr<ui::ClipboardDataEndpoint> data_src) override; void WritePlatformRepresentations( ui::ClipboardBuffer buffer, - std::vector<Clipboard::PlatformRepresentation> platform_representations) - override; + std::vector<Clipboard::PlatformRepresentation> platform_representations, + std::unique_ptr<ui::ClipboardDataEndpoint> data_src) override; void WriteText(const char* text_data, size_t text_len) override; void WriteHTML(const char* markup_data, size_t markup_len, diff --git a/chromium/headless/lib/browser/headless_content_browser_client.cc b/chromium/headless/lib/browser/headless_content_browser_client.cc index 2631cc0a810..408aee35cc1 100644 --- a/chromium/headless/lib/browser/headless_content_browser_client.cc +++ b/chromium/headless/lib/browser/headless_content_browser_client.cc @@ -34,7 +34,7 @@ #include "net/base/url_util.h" #include "net/ssl/client_cert_identity.h" #include "printing/buildflags/buildflags.h" -#include "services/service_manager/sandbox/switches.h" +#include "sandbox/policy/switches.h" #include "ui/base/ui_base_switches.h" #include "ui/gfx/switches.h" @@ -158,7 +158,7 @@ HeadlessContentBrowserClient::GetGeneratedCodeCacheSettings( return content::GeneratedCodeCacheSettings(true, 0, context->GetPath()); } -#if defined(OS_POSIX) && !defined(OS_MACOSX) +#if defined(OS_POSIX) && !defined(OS_MAC) void HeadlessContentBrowserClient::GetAdditionalMappedFilesForChildProcess( const base::CommandLine& command_line, int child_process_id, @@ -169,7 +169,7 @@ void HeadlessContentBrowserClient::GetAdditionalMappedFilesForChildProcess( mappings->Share(service_manager::kCrashDumpSignal, crash_signal_fd); #endif // defined(HEADLESS_USE_BREAKPAD) } -#endif // defined(OS_POSIX) && !defined(OS_MACOSX) +#endif // defined(OS_POSIX) && !defined(OS_MAC) void HeadlessContentBrowserClient::AppendExtraCommandLineSwitches( base::CommandLine* command_line, @@ -241,10 +241,10 @@ void HeadlessContentBrowserClient::AppendExtraCommandLineSwitches( process_type, child_process_id); } -#if defined(OS_LINUX) +#if defined(OS_LINUX) || defined(OS_CHROMEOS) // Processes may only query perf_event_open with the BPF sandbox disabled. if (old_command_line.HasSwitch(::switches::kEnableThreadInstructionCount) && - old_command_line.HasSwitch(service_manager::switches::kNoSandbox)) { + old_command_line.HasSwitch(sandbox::policy::switches::kNoSandbox)) { command_line->AppendSwitch(::switches::kEnableThreadInstructionCount); } #endif diff --git a/chromium/headless/lib/browser/headless_content_browser_client.h b/chromium/headless/lib/browser/headless_content_browser_client.h index 2f6ecd8ec12..f462b9f3ce0 100644 --- a/chromium/headless/lib/browser/headless_content_browser_client.h +++ b/chromium/headless/lib/browser/headless_content_browser_client.h @@ -29,7 +29,7 @@ class HeadlessContentBrowserClient : public content::ContentBrowserClient { override; content::GeneratedCodeCacheSettings GetGeneratedCodeCacheSettings( content::BrowserContext* context) override; -#if defined(OS_POSIX) && !defined(OS_MACOSX) +#if defined(OS_POSIX) && !defined(OS_MAC) void GetAdditionalMappedFilesForChildProcess( const base::CommandLine& command_line, int child_process_id, diff --git a/chromium/headless/lib/browser/headless_print_manager.cc b/chromium/headless/lib/browser/headless_print_manager.cc index d524f7b786f..413d23c3c5b 100644 --- a/chromium/headless/lib/browser/headless_print_manager.cc +++ b/chromium/headless/lib/browser/headless_print_manager.cc @@ -12,10 +12,13 @@ #include "base/strings/string_number_conversions.h" #include "base/strings/string_piece.h" #include "base/strings/string_split.h" +#include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" #include "components/printing/browser/print_manager_utils.h" +#include "components/printing/common/print.mojom.h" #include "components/printing/common/print_messages.h" #include "content/public/browser/render_view_host.h" +#include "printing/mojom/print.mojom.h" #include "printing/print_job_constants.h" #include "printing/units.h" @@ -83,11 +86,11 @@ HeadlessPrintManager::PageRangeTextToPages(base::StringPiece page_range_text, } else if (range_string == "-") { range.from = 1; range.to = pages_count; - } else if (range_string.starts_with("-")) { + } else if (base::StartsWith(range_string, "-")) { range.from = 1; if (!base::StringToInt(range_string.substr(1), &range.to)) return SYNTAX_ERROR; - } else if (range_string.ends_with("-")) { + } else if (base::EndsWith(range_string, "-")) { range.to = pages_count; if (!base::StringToInt(range_string.substr(0, range_string.length() - 1), &range.from)) @@ -163,7 +166,7 @@ HeadlessPrintManager::GetPrintParamsFromSettings( print_settings.set_url(base::UTF8ToUTF16(url)); } - print_settings.set_margin_type(printing::CUSTOM_MARGINS); + print_settings.set_margin_type(printing::mojom::MarginType::kCustomMargins); print_settings.SetCustomMargins(settings.margins_in_points); gfx::Rect printable_area_device_units(settings.paper_size_in_points); @@ -267,9 +270,9 @@ void HeadlessPrintManager::OnPrintingFailed(int cookie) { void HeadlessPrintManager::OnDidPrintDocument( content::RenderFrameHost* render_frame_host, - const PrintHostMsg_DidPrintDocument_Params& params, + const printing::mojom::DidPrintDocumentParams& params, std::unique_ptr<DelayedFrameDispatchHelper> helper) { - auto& content = params.content; + auto& content = *params.content; if (!content.metafile_data_region.IsValid()) { ReleaseJob(INVALID_MEMORY_HANDLE); return; diff --git a/chromium/headless/lib/browser/headless_print_manager.h b/chromium/headless/lib/browser/headless_print_manager.h index bdd5fae12ee..998db62dafd 100644 --- a/chromium/headless/lib/browser/headless_print_manager.h +++ b/chromium/headless/lib/browser/headless_print_manager.h @@ -11,12 +11,12 @@ #include "base/memory/ref_counted_memory.h" #include "components/printing/browser/print_manager.h" +#include "components/printing/common/print.mojom-forward.h" #include "content/public/browser/render_frame_host.h" #include "content/public/browser/web_contents_user_data.h" #include "headless/public/headless_export.h" #include "printing/print_settings.h" -struct PrintHostMsg_DidPrintDocument_Params; struct PrintHostMsg_ScriptedPrint_Params; struct PrintMsg_PrintPages_Params; @@ -100,7 +100,7 @@ class HeadlessPrintManager // printing::PrintManager: void OnDidPrintDocument( content::RenderFrameHost* render_frame_host, - const PrintHostMsg_DidPrintDocument_Params& params, + const printing::mojom::DidPrintDocumentParams& params, std::unique_ptr<DelayedFrameDispatchHelper> helper) override; void OnGetDefaultPrintSettings(content::RenderFrameHost* render_frame_host, IPC::Message* reply_msg) override; diff --git a/chromium/headless/lib/browser/headless_request_context_manager.cc b/chromium/headless/lib/browser/headless_request_context_manager.cc index adba8cecd22..ebd811ccdd8 100644 --- a/chromium/headless/lib/browser/headless_request_context_manager.cc +++ b/chromium/headless/lib/browser/headless_request_context_manager.cc @@ -168,7 +168,7 @@ HeadlessRequestContextManager::CreateSystemContext( base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); auto auth_params = ::network::mojom::HttpAuthDynamicParams::New(); auth_params->server_allowlist = - command_line->GetSwitchValueASCII(switches::kAuthServerWhitelist); + command_line->GetSwitchValueASCII(switches::kAuthServerAllowlist); auto* network_service = content::GetNetworkService(); network_service->ConfigureHttpAuthPrefs(std::move(auth_params)); diff --git a/chromium/headless/lib/browser/protocol/target_handler.cc b/chromium/headless/lib/browser/protocol/target_handler.cc index fbff74e42e2..74181965b69 100644 --- a/chromium/headless/lib/browser/protocol/target_handler.cc +++ b/chromium/headless/lib/browser/protocol/target_handler.cc @@ -34,7 +34,7 @@ Response TargetHandler::CreateTarget(const std::string& url, Maybe<bool> new_window, Maybe<bool> background, std::string* out_target_id) { -#if defined(OS_MACOSX) +#if defined(OS_MAC) if (enable_begin_frame_control.fromMaybe(false)) { return Response::ServerError( "BeginFrameControl is not supported on MacOS yet"); diff --git a/chromium/headless/lib/headless_browser_browsertest.cc b/chromium/headless/lib/headless_browser_browsertest.cc index 9dc68729e5b..91984ac4ccc 100644 --- a/chromium/headless/lib/headless_browser_browsertest.cc +++ b/chromium/headless/lib/headless_browser_browsertest.cc @@ -42,7 +42,7 @@ #include "ui/base/clipboard/scoped_clipboard_writer.h" #include "ui/gfx/geometry/size.h" -#if defined(OS_MACOSX) +#if defined(OS_MAC) #include "third_party/crashpad/crashpad/client/crash_report_database.h" #endif @@ -212,7 +212,7 @@ class HeadlessBrowserTestWithProxy : public HeadlessBrowserTest { net::SpawnedTestServer proxy_server_; }; -#if defined(OS_WIN) || (defined(OS_MACOSX) && defined(ADDRESS_SANITIZER)) +#if defined(OS_WIN) || (defined(OS_MAC) && defined(ADDRESS_SANITIZER)) // TODO(crbug.com/1045971): Disabled due to flakiness. // TODO(crbug.com/1086872): Disabled due to flakiness on Mac ASAN. #define MAYBE_SetProxyConfig DISABLED_SetProxyConfig @@ -281,7 +281,7 @@ IN_PROC_BROWSER_TEST_F(HeadlessBrowserTest, ClipboardCopyPasteText) { writer.WriteText(paste_text); } base::string16 copy_text; - clipboard->ReadText(buffer, ©_text); + clipboard->ReadText(buffer, /* data_dst = */ nullptr, ©_text); EXPECT_EQ(paste_text, copy_text); } } @@ -302,7 +302,7 @@ IN_PROC_BROWSER_TEST_F(HeadlessBrowserTest, MAYBE_DefaultSizes) { HeadlessBrowser::Options::Builder builder; const HeadlessBrowser::Options kDefaultOptions = builder.Build(); -#if !defined(OS_MACOSX) +#if !defined(OS_MAC) // On Mac headless does not override the screen dimensions, so they are // left with the actual screen values. EXPECT_EQ(kDefaultOptions.window_size.width(), @@ -315,7 +315,7 @@ IN_PROC_BROWSER_TEST_F(HeadlessBrowserTest, MAYBE_DefaultSizes) { ->GetResult() ->GetValue() ->GetInt()); -#endif // !defined(OS_MACOSX) +#endif // !defined(OS_MAC) EXPECT_EQ(kDefaultOptions.window_size.width(), EvaluateScript(web_contents, "window.innerWidth") ->GetResult() @@ -399,9 +399,9 @@ class HeadlessBrowserRendererCommandPrefixTest : public HeadlessBrowserTest { void TearDown() override { if (!launcher_script_.empty()) - base::DeleteFile(launcher_script_, false); + base::DeleteFile(launcher_script_); if (!launcher_stamp_.empty()) - base::DeleteFile(launcher_stamp_, false); + base::DeleteFile(launcher_stamp_); } void SetUpCommandLine(base::CommandLine* command_line) override { @@ -454,7 +454,7 @@ class CrashReporterTest : public HeadlessBrowserTest, void TearDown() override { base::ThreadRestrictions::SetIOAllowed(true); - base::DeleteFile(crash_dumps_dir_, /* recursive */ false); + base::DeleteFile(crash_dumps_dir_); } // HeadlessWebContents::Observer implementation: @@ -479,12 +479,12 @@ class CrashReporterTest : public HeadlessBrowserTest, // TODO(skyostil): Minidump generation currently is only supported on Linux and // Mac. -#if (defined(HEADLESS_USE_BREAKPAD) || defined(OS_MACOSX)) && \ +#if (defined(HEADLESS_USE_BREAKPAD) || defined(OS_MAC)) && \ !defined(ADDRESS_SANITIZER) #define MAYBE_GenerateMinidump GenerateMinidump #else #define MAYBE_GenerateMinidump DISABLED_GenerateMinidump -#endif // defined(HEADLESS_USE_BREAKPAD) || defined(OS_MACOSX) +#endif // defined(HEADLESS_USE_BREAKPAD) || defined(OS_MAC) IN_PROC_BROWSER_TEST_F(CrashReporterTest, MAYBE_GenerateMinidump) { content::ScopedAllowRendererCrashes scoped_allow_renderer_crashes; @@ -510,7 +510,7 @@ IN_PROC_BROWSER_TEST_F(CrashReporterTest, MAYBE_GenerateMinidump) { { base::ThreadRestrictions::SetIOAllowed(true); -#if defined(OS_MACOSX) +#if defined(OS_MAC) auto database = crashpad::CrashReportDatabase::Initialize(crash_dumps_dir_); std::vector<crashpad::CrashReportDatabase::Report> reports; ASSERT_EQ(database->GetPendingReports(&reports), diff --git a/chromium/headless/lib/headless_browser_context_browsertest.cc b/chromium/headless/lib/headless_browser_context_browsertest.cc index 9dd552cdc54..a97bc78dfbd 100644 --- a/chromium/headless/lib/headless_browser_context_browsertest.cc +++ b/chromium/headless/lib/headless_browser_context_browsertest.cc @@ -272,8 +272,8 @@ IN_PROC_BROWSER_TEST_F(HeadlessBrowserTest, ContextWebPreferences) { HeadlessWebContentsImpl* contents_impl = HeadlessWebContentsImpl::From(web_contents); EXPECT_TRUE(contents_impl->web_contents() - ->GetRenderViewHost() - ->GetWebkitPreferences().hide_scrollbars); + ->GetOrCreateWebPreferences() + .hide_scrollbars); } } // namespace headless diff --git a/chromium/headless/lib/headless_content_main_delegate.cc b/chromium/headless/lib/headless_content_main_delegate.cc index 6805126fd7c..230fa998d2f 100644 --- a/chromium/headless/lib/headless_content_main_delegate.cc +++ b/chromium/headless/lib/headless_content_main_delegate.cc @@ -34,8 +34,8 @@ #include "headless/lib/headless_macros.h" #include "headless/lib/renderer/headless_content_renderer_client.h" #include "headless/lib/utility/headless_content_utility_client.h" +#include "sandbox/policy/switches.h" #include "services/service_manager/embedder/switches.h" -#include "services/service_manager/sandbox/switches.h" #include "third_party/blink/public/common/switches.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" @@ -48,11 +48,11 @@ #include "headless/embedded_resource_pak.h" #endif -#if defined(OS_MACOSX) || defined(OS_WIN) +#if defined(OS_MAC) || defined(OS_WIN) #include "components/crash/core/app/crashpad.h" #endif -#if defined(OS_LINUX) +#if defined(OS_LINUX) || defined(OS_CHROMEOS) #include "components/crash/core/app/breakpad_linux.h" #endif @@ -130,7 +130,7 @@ void InitializeResourceBundle(const base::CommandLine& command_line) { base::FilePath chrome_200_pak = dir_module.Append(FILE_PATH_LITERAL("chrome_200_percent.pak")); -#if defined(OS_MACOSX) && !defined(COMPONENT_BUILD) +#if defined(OS_MAC) && !defined(COMPONENT_BUILD) // In non component builds, check if fall back in Resources/ folder is // available. if (!base::PathExists(resources_pak)) { @@ -198,7 +198,7 @@ bool HeadlessContentMainDelegate::BasicStartupComplete(int* exit_code) { command_line->AppendSwitch(::switches::kSingleProcess); if (options()->disable_sandbox) - command_line->AppendSwitch(service_manager::switches::kNoSandbox); + command_line->AppendSwitch(sandbox::policy::switches::kNoSandbox); if (!options()->enable_resource_scheduler) command_line->AppendSwitch(::switches::kDisableResourceScheduler); @@ -233,7 +233,7 @@ bool HeadlessContentMainDelegate::BasicStartupComplete(int* exit_code) { #if defined(OS_WIN) command_line->AppendSwitch( - ::switches::kDisableGpuProcessForDX12VulkanInfoCollection); + ::switches::kDisableGpuProcessForDX12InfoCollection); #endif content::Profiling::ProcessStarted(); @@ -344,7 +344,7 @@ void HeadlessContentMainDelegate::InitCrashReporter( } if (process_type != service_manager::switches::kZygoteProcess) breakpad::InitCrashReporter(process_type); -#elif defined(OS_MACOSX) +#elif defined(OS_MAC) crash_reporter::InitializeCrashpad(process_type.empty(), process_type); // Avoid adding this dependency in Windows Chrome non component builds, since // crashpad is already enabled. @@ -405,7 +405,7 @@ int HeadlessContentMainDelegate::RunProcess( return 0; } -#if defined(OS_LINUX) +#if defined(OS_LINUX) || defined(OS_CHROMEOS) void SIGTERMProfilingShutdown(int signal) { content::Profiling::Stop(); struct sigaction sigact; @@ -440,7 +440,7 @@ void HeadlessContentMainDelegate::ZygoteForked() { breakpad::InitCrashReporter(process_type); #endif } -#endif // defined(OS_LINUX) +#endif // defined(OS_LINUX) || defined(OS_CHROMEOS) // static HeadlessContentMainDelegate* HeadlessContentMainDelegate::GetInstance() { diff --git a/chromium/headless/lib/headless_content_main_delegate.h b/chromium/headless/lib/headless_content_main_delegate.h index 42c9772d1c6..914c3b0ff9f 100644 --- a/chromium/headless/lib/headless_content_main_delegate.h +++ b/chromium/headless/lib/headless_content_main_delegate.h @@ -45,7 +45,7 @@ class HEADLESS_EXPORT HeadlessContentMainDelegate int RunProcess( const std::string& process_type, const content::MainFunctionParams& main_function_params) override; -#if defined(OS_MACOSX) +#if defined(OS_MAC) void PreCreateMainMessageLoop() override; #endif content::ContentClient* CreateContentClient() override; @@ -57,7 +57,7 @@ class HEADLESS_EXPORT HeadlessContentMainDelegate HeadlessBrowserImpl* browser() const { return browser_.get(); } -#if defined(OS_LINUX) +#if defined(OS_LINUX) || defined(OS_CHROMEOS) void ZygoteForked() override; #endif diff --git a/chromium/headless/lib/headless_crash_reporter_client.cc b/chromium/headless/lib/headless_crash_reporter_client.cc index 45dff7618a2..9a8d104727f 100644 --- a/chromium/headless/lib/headless_crash_reporter_client.cc +++ b/chromium/headless/lib/headless_crash_reporter_client.cc @@ -19,7 +19,7 @@ namespace headless { namespace { -#if defined(OS_POSIX) && !defined(OS_MACOSX) +#if defined(OS_POSIX) && !defined(OS_MAC) constexpr char kChromeHeadlessProductName[] = "Chrome_Headless"; @@ -30,7 +30,7 @@ constexpr char kChromeHeadlessProductName[] = "Chrome_Headless"; HeadlessCrashReporterClient::HeadlessCrashReporterClient() = default; HeadlessCrashReporterClient::~HeadlessCrashReporterClient() = default; -#if defined(OS_POSIX) && !defined(OS_MACOSX) +#if defined(OS_POSIX) && !defined(OS_MAC) void HeadlessCrashReporterClient::GetProductNameAndVersion( const char** product_name, const char** version) { @@ -50,7 +50,7 @@ void HeadlessCrashReporterClient::GetProductNameAndVersion( base::FilePath HeadlessCrashReporterClient::GetReporterLogFilename() { return base::FilePath(FILE_PATH_LITERAL("uploads.log")); } -#endif // defined(OS_POSIX) && !defined(OS_MACOSX) +#endif // defined(OS_POSIX) && !defined(OS_MAC) bool HeadlessCrashReporterClient::GetCrashDumpLocation( #if defined(OS_WIN) diff --git a/chromium/headless/lib/headless_crash_reporter_client.h b/chromium/headless/lib/headless_crash_reporter_client.h index 31da13efe50..1b8579e2e82 100644 --- a/chromium/headless/lib/headless_crash_reporter_client.h +++ b/chromium/headless/lib/headless_crash_reporter_client.h @@ -23,7 +23,7 @@ class HeadlessCrashReporterClient : public crash_reporter::CrashReporterClient { } const base::FilePath& crash_dumps_dir() const { return crash_dumps_dir_; } -#if defined(OS_POSIX) && !defined(OS_MACOSX) +#if defined(OS_POSIX) && !defined(OS_MAC) // Returns a textual description of the product type and version to include // in the crash report. void GetProductNameAndVersion(const char** product_name, @@ -34,7 +34,7 @@ class HeadlessCrashReporterClient : public crash_reporter::CrashReporterClient { std::string* channel) override; base::FilePath GetReporterLogFilename() override; -#endif // defined(OS_POSIX) && !defined(OS_MACOSX) +#endif // defined(OS_POSIX) && !defined(OS_MAC) #if defined(OS_WIN) bool GetCrashDumpLocation(base::string16* crash_dir) override; diff --git a/chromium/headless/lib/headless_devtools_client_browsertest.cc b/chromium/headless/lib/headless_devtools_client_browsertest.cc index ebca8482536..0e53a82a2f9 100644 --- a/chromium/headless/lib/headless_devtools_client_browsertest.cc +++ b/chromium/headless/lib/headless_devtools_client_browsertest.cc @@ -143,10 +143,10 @@ class HeadlessDevToolsClientWindowManagementTest std::unique_ptr<browser::GetWindowBoundsResult> result) { const browser::Bounds* actual_bounds = result->GetBounds(); // Mac does not support repositioning, as we don't show any actual window. -#if !defined(OS_MACOSX) +#if !defined(OS_MAC) EXPECT_EQ(bounds.x(), actual_bounds->GetLeft()); EXPECT_EQ(bounds.y(), actual_bounds->GetTop()); -#endif // !defined(OS_MACOSX) +#endif // !defined(OS_MAC) EXPECT_EQ(bounds.width(), actual_bounds->GetWidth()); EXPECT_EQ(bounds.height(), actual_bounds->GetHeight()); EXPECT_EQ(state, actual_bounds->GetWindowState()); @@ -178,7 +178,7 @@ class HeadlessDevToolsClientChangeWindowBoundsTest } }; -#if defined(OS_WIN) || (defined(OS_MACOSX) && defined(ADDRESS_SANITIZER)) +#if defined(OS_WIN) || (defined(OS_MAC) && defined(ADDRESS_SANITIZER)) // TODO(crbug.com/1045980): Disabled due to flakiness. // TODO(crbug.com/1086872): Disabled due to flakiness on Mac ASAN. DISABLED_HEADLESS_ASYNC_DEVTOOLED_TEST_F( @@ -187,6 +187,42 @@ DISABLED_HEADLESS_ASYNC_DEVTOOLED_TEST_F( HEADLESS_ASYNC_DEVTOOLED_TEST_F(HeadlessDevToolsClientChangeWindowBoundsTest); #endif +class HeadlessDevToolsClientOuterSizeTest + : public HeadlessDevToolsClientWindowManagementTest { + void RunDevTooledTest() override { + SetWindowBounds( + gfx::Rect(100, 200, 800, 600), + base::BindOnce(&HeadlessDevToolsClientOuterSizeTest::OnSetWindowBounds, + base::Unretained(this))); + } + + void OnSetWindowBounds( + std::unique_ptr<browser::SetWindowBoundsResult> result) { + devtools_client_->GetRuntime()->Evaluate( + "window.outerWidth", + base::BindOnce(&HeadlessDevToolsClientOuterSizeTest::OnOuterWidthResult, + base::Unretained(this))); + devtools_client_->GetRuntime()->Evaluate( + "window.outerHeight", + base::BindOnce( + &HeadlessDevToolsClientOuterSizeTest::OnOuterHeightResult, + base::Unretained(this))); + } + + void OnOuterWidthResult(std::unique_ptr<runtime::EvaluateResult> result) { + EXPECT_TRUE(result->GetResult()->HasValue()); + EXPECT_EQ(800, result->GetResult()->GetValue()->GetInt()); + } + + void OnOuterHeightResult(std::unique_ptr<runtime::EvaluateResult> result) { + EXPECT_TRUE(result->GetResult()->HasValue()); + EXPECT_EQ(600, result->GetResult()->GetValue()->GetInt()); + FinishAsynchronousTest(); + } +}; + +HEADLESS_ASYNC_DEVTOOLED_TEST_F(HeadlessDevToolsClientOuterSizeTest); + class HeadlessDevToolsClientChangeWindowStateTest : public HeadlessDevToolsClientWindowManagementTest { public: @@ -524,7 +560,7 @@ class HeadlessCrashObserverTest : public HeadlessAsyncDevTooledBrowserTest, // ASan's normal error exit code is 1, which base categorizes as the process // being killed. EXPECT_EQ(base::TERMINATION_STATUS_PROCESS_WAS_KILLED, status); -#elif defined(OS_WIN) || defined(OS_MACOSX) +#elif defined(OS_WIN) || defined(OS_MAC) EXPECT_EQ(base::TERMINATION_STATUS_PROCESS_CRASHED, status); #else EXPECT_EQ(base::TERMINATION_STATUS_ABNORMAL_TERMINATION, status); @@ -1204,7 +1240,7 @@ class DevtoolsInterceptionWithAuthProxyTest std::set<std::string> files_loaded_; }; -#if defined(OS_WIN) || (defined(OS_MACOSX) && defined(ADDRESS_SANITIZER)) +#if defined(OS_WIN) || (defined(OS_MAC) && defined(ADDRESS_SANITIZER)) // TODO(crbug.com/1045980): Disabled due to flakiness. // TODO(crbug.com/1086872): Disabled due to flakiness on Mac ASAN. DISABLED_HEADLESS_ASYNC_DEVTOOLED_TEST_F(DevtoolsInterceptionWithAuthProxyTest); diff --git a/chromium/headless/lib/headless_macros.h b/chromium/headless/lib/headless_macros.h index f8d57aee346..f7bb9af1171 100644 --- a/chromium/headless/lib/headless_macros.h +++ b/chromium/headless/lib/headless_macros.h @@ -7,8 +7,8 @@ #include "build/build_config.h" -#if defined(OS_POSIX) && !defined(OS_MACOSX) +#if defined(OS_POSIX) && !defined(OS_MAC) #define HEADLESS_USE_BREAKPAD -#endif // defined(OS_POSIX) && !defined(OS_MACOSX) +#endif // defined(OS_POSIX) && !defined(OS_MAC) #endif // HEADLESS_LIB_HEADLESS_MACROS_H_ diff --git a/chromium/headless/lib/headless_web_contents_browsertest.cc b/chromium/headless/lib/headless_web_contents_browsertest.cc index d323c77e1ac..52690718e63 100644 --- a/chromium/headless/lib/headless_web_contents_browsertest.cc +++ b/chromium/headless/lib/headless_web_contents_browsertest.cc @@ -122,14 +122,14 @@ IN_PROC_BROWSER_TEST_F(HeadlessWebContentsTest, MAYBE_WindowOpen) { EXPECT_NE(parent->window_tree_host(), child->window_tree_host()); gfx::Rect expected_bounds(0, 0, 200, 100); -#if !defined(OS_MACOSX) +#if !defined(OS_MAC) EXPECT_EQ(expected_bounds, child->web_contents()->GetViewBounds()); EXPECT_EQ(expected_bounds, child->web_contents()->GetContainerBounds()); -#else // !defined(OS_MACOSX) +#else // !defined(OS_MAC) // Mac does not support GetViewBounds() and view positions are random. EXPECT_EQ(expected_bounds.size(), child->web_contents()->GetContainerBounds().size()); -#endif // !defined(OS_MACOSX) +#endif // !defined(OS_MAC) } #if defined(OS_WIN) @@ -296,7 +296,7 @@ HEADLESS_ASYNC_DEVTOOLED_TEST_P( #endif // Instantiate test case for both software and gpu compositing modes. -#if defined(OS_WIN) || (defined(OS_MACOSX) && defined(ADDRESS_SANITIZER)) +#if defined(OS_WIN) || (defined(OS_MAC) && defined(ADDRESS_SANITIZER)) // TODO(crbug.com/1045980): Disabled on Windows due to flakiness. // TODO(crbug.com/1086872): Disabled due to flakiness on Mac ASAN. INSTANTIATE_TEST_SUITE_P(HeadlessWebContentsScreenshotWindowPositionTests, @@ -370,7 +370,8 @@ class HeadlessWebContentsPDFTest : public HeadlessAsyncDevTooledBrowserTest { EXPECT_TRUE(chrome_pdf::RenderPDFPageToBitmap( pdf_span, i, page_bitmap_data.data(), settings.area.size().width(), settings.area.size().height(), settings.dpi.width(), - settings.dpi.height(), settings.autorotate, settings.use_color)); + settings.dpi.height(), /*stretch_to_bounds=*/false, + /*keep_aspect_ratio=*/true, settings.autorotate, settings.use_color)); EXPECT_EQ(0x56, page_bitmap_data[0]); // B EXPECT_EQ(0x34, page_bitmap_data[1]); // G EXPECT_EQ(0x12, page_bitmap_data[2]); // R @@ -520,6 +521,7 @@ class HeadlessWebContentsPDFPageSizeRoundingTest HEADLESS_ASYNC_DEVTOOLED_TEST_F(HeadlessWebContentsPDFPageSizeRoundingTest); const char kExpectedStructTreeJSON[] = R"({ + "lang": "en", "type": "Document", "~children": [ { "type": "H1", @@ -592,6 +594,12 @@ const char kExpectedStructTreeJSON[] = R"({ "alt": "Car at the beach", "type": "Figure" } ] + }, { + "lang": "fr", + "type": "P", + "~children": [ { + "type": "NonStruct" + } ] } ] } )"; @@ -781,7 +789,7 @@ IN_PROC_BROWSER_TEST_F(HeadlessWebContentsTest, MAYBE_BrowserOpenInTab) { } // BeginFrameControl is not supported on MacOS. -#if !defined(OS_MACOSX) +#if !defined(OS_MAC) class HeadlessWebContentsBeginFrameControlTest : public HeadlessBrowserTest, @@ -1111,7 +1119,7 @@ HEADLESS_ASYNC_DEVTOOLED_TEST_F( HeadlessWebContentsBeginFrameControlViewportTest); #endif -#endif // !defined(OS_MACOSX) +#endif // !defined(OS_MAC) class CookiesEnabled : public HeadlessAsyncDevTooledBrowserTest, page::Observer { @@ -1201,7 +1209,8 @@ class DontBlockWebContentsOpenTest : public WebContentsOpenTest { } }; -#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_FUCHSIA) +#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS) || \ + defined(OS_FUCHSIA) // TODO(crbug.com/1045980): Disabled due to flakiness. // TODO(crbug.com/1078405): Disabled due to flakiness. // TODO(crbug.com/1090936): Disabled due to flakiness. diff --git a/chromium/headless/public/headless_web_contents.h b/chromium/headless/public/headless_web_contents.h index 873aa76cba3..0d8249f8551 100644 --- a/chromium/headless/public/headless_web_contents.h +++ b/chromium/headless/public/headless_web_contents.h @@ -14,7 +14,6 @@ #include "base/process/kill.h" #include "headless/public/headless_devtools_channel.h" #include "headless/public/headless_export.h" -#include "mojo/public/cpp/bindings/interface_request.h" #include "ui/gfx/geometry/size.h" #include "url/gurl.h" |