Update to Chromium version 56.0.2924.51

This commit is contained in:
Marshall Greenblatt 2017-01-11 18:22:19 -05:00
parent e63e109489
commit 5c07d06435
10 changed files with 95 additions and 80 deletions

View File

@ -7,5 +7,5 @@
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
{
'chromium_checkout': 'refs/tags/56.0.2924.10',
'chromium_checkout': 'refs/tags/56.0.2924.51',
}

View File

@ -247,14 +247,12 @@ void CefPrintingMessageFilter::OnUpdatePrintSettings(
}
printer_query = queue_->PopPrinterQuery(document_cookie);
if (!printer_query.get()) {
int host_id = render_process_id_;
int routing_id = reply_msg->routing_id();
if (!new_settings->GetInteger(printing::kPreviewInitiatorHostId,
&host_id) ||
!new_settings->GetInteger(printing::kPreviewInitiatorRoutingId,
&routing_id)) {
int host_id;
int routing_id;
if (!new_settings->GetInteger(kPreviewInitiatorHostId, &host_id) ||
!new_settings->GetInteger(kPreviewInitiatorRoutingId, &routing_id)) {
host_id = content::ChildProcessHost::kInvalidUniqueID;
routing_id = content::ChildProcessHost::kInvalidUniqueID;
routing_id = MSG_ROUTING_NONE;
}
printer_query = queue_->CreatePrinterQuery(host_id, routing_id);
}
@ -276,11 +274,10 @@ void CefPrintingMessageFilter::OnUpdatePrintSettingsReply(
params.params.document_cookie = printer_query->cookie();
params.pages = PageRange::GetPages(printer_query->settings().ranges());
}
PrintHostMsg_UpdatePrintSettings::WriteReplyParams(
reply_msg,
params,
printer_query.get() &&
(printer_query->last_status() == printing::PrintingContext::CANCEL));
bool canceled = printer_query.get() &&
(printer_query->last_status() == PrintingContext::CANCEL);
PrintHostMsg_UpdatePrintSettings::WriteReplyParams(reply_msg, params,
canceled);
Send(reply_msg);
// If user hasn't cancelled.
if (printer_query.get()) {

View File

@ -39,10 +39,10 @@ index f2a854f..913e30c 100644
// built in media player for the given |url|. Defaults to false.
virtual bool ShouldUseMediaPlayerForURL(const GURL& url);
diff --git renderer/render_frame_impl.cc renderer/render_frame_impl.cc
index 2f79ac0..7e0c73b 100644
index c0d7575..c1ea8e6 100644
--- renderer/render_frame_impl.cc
+++ renderer/render_frame_impl.cc
@@ -5112,7 +5112,6 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation(
@@ -5120,7 +5120,6 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation(
(pending_navigation_params_ &&
!pending_navigation_params_->request_params.redirects.empty());
@ -50,7 +50,7 @@ index 2f79ac0..7e0c73b 100644
// The handlenavigation API is deprecated and will be removed once
// crbug.com/325351 is resolved.
if (GetContentClient()->renderer()->HandleNavigation(
@@ -5121,7 +5120,6 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation(
@@ -5129,7 +5128,6 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation(
is_redirect)) {
return blink::WebNavigationPolicyIgnore;
}

View File

@ -178,7 +178,7 @@ index 3d1e71a..a876c2a 100644
PrintHostMsg_SetOptionsFromDocument_Params /* params */)
-#endif // BUILDFLAG(ENABLE_PRINT_PREVIEW)
diff --git components/printing/renderer/print_web_view_helper.cc components/printing/renderer/print_web_view_helper.cc
index e343eef..025671c 100644
index c72217a..2eb3a52 100644
--- components/printing/renderer/print_web_view_helper.cc
+++ components/printing/renderer/print_web_view_helper.cc
@@ -88,6 +88,9 @@ const float kPrintingMinimumShrinkFactor = 1.333f;
@ -268,7 +268,7 @@ index e343eef..025671c 100644
} else {
#if BUILDFLAG(ENABLE_BASIC_PRINTING)
Print(web_frame, blink::WebNode(), true /* is_scripted? */);
@@ -988,14 +981,10 @@ bool PrintWebViewHelper::OnMessageReceived(const IPC::Message& message) {
@@ -992,14 +985,10 @@ bool PrintWebViewHelper::OnMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_HANDLER(PrintMsg_PrintPages, OnPrintPages)
IPC_MESSAGE_HANDLER(PrintMsg_PrintForSystemDialog, OnPrintForSystemDialog)
#endif // BUILDFLAG(ENABLE_BASIC_PRINTING)
@ -283,7 +283,7 @@ index e343eef..025671c 100644
IPC_MESSAGE_HANDLER(PrintMsg_SetPrintingEnabled, OnSetPrintingEnabled)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
@@ -1033,7 +1022,6 @@ void PrintWebViewHelper::OnPrintForSystemDialog() {
@@ -1043,7 +1032,6 @@ void PrintWebViewHelper::OnPrintForSystemDialog() {
}
#endif // BUILDFLAG(ENABLE_BASIC_PRINTING)
@ -291,7 +291,7 @@ index e343eef..025671c 100644
void PrintWebViewHelper::OnPrintForPrintPreview(
const base::DictionaryValue& job_settings) {
CHECK_LE(ipc_nesting_level_, 1);
@@ -1092,7 +1080,6 @@ void PrintWebViewHelper::OnPrintForPrintPreview(
@@ -1102,7 +1090,6 @@ void PrintWebViewHelper::OnPrintForPrintPreview(
DidFinishPrinting(FAIL_PRINT);
}
}
@ -299,7 +299,7 @@ index e343eef..025671c 100644
void PrintWebViewHelper::GetPageSizeAndContentAreaFromPageLayout(
const PageSizeMargins& page_layout_in_points,
@@ -1117,7 +1104,6 @@ void PrintWebViewHelper::UpdateFrameMarginsCssInfo(
@@ -1127,7 +1114,6 @@ void PrintWebViewHelper::UpdateFrameMarginsCssInfo(
ignore_css_margins_ = (margins_type != DEFAULT_MARGINS);
}
@ -307,7 +307,7 @@ index e343eef..025671c 100644
void PrintWebViewHelper::OnPrintPreview(const base::DictionaryValue& settings) {
if (ipc_nesting_level_ > 1)
return;
@@ -1302,7 +1288,7 @@ bool PrintWebViewHelper::CreatePreviewDocument() {
@@ -1312,7 +1298,7 @@ bool PrintWebViewHelper::CreatePreviewDocument() {
return true;
}
@ -316,7 +316,7 @@ index e343eef..025671c 100644
bool PrintWebViewHelper::RenderPreviewPage(
int page_number,
const PrintMsg_Print_Params& print_params) {
@@ -1332,7 +1318,7 @@ bool PrintWebViewHelper::RenderPreviewPage(
@@ -1342,7 +1328,7 @@ bool PrintWebViewHelper::RenderPreviewPage(
}
return PreviewPageRendered(page_number, draft_metafile.get());
}
@ -325,7 +325,7 @@ index e343eef..025671c 100644
bool PrintWebViewHelper::FinalizePrintReadyDocument() {
DCHECK(!is_print_ready_metafile_sent_);
@@ -1362,7 +1348,6 @@ bool PrintWebViewHelper::FinalizePrintReadyDocument() {
@@ -1372,7 +1358,6 @@ bool PrintWebViewHelper::FinalizePrintReadyDocument() {
Send(new PrintHostMsg_MetafileReadyForPrinting(routing_id(), preview_params));
return true;
}
@ -333,7 +333,7 @@ index e343eef..025671c 100644
void PrintWebViewHelper::OnPrintingDone(bool success) {
if (ipc_nesting_level_ > 1)
@@ -1377,7 +1362,6 @@ void PrintWebViewHelper::OnSetPrintingEnabled(bool enabled) {
@@ -1387,7 +1372,6 @@ void PrintWebViewHelper::OnSetPrintingEnabled(bool enabled) {
is_printing_enabled_ = enabled;
}
@ -341,7 +341,7 @@ index e343eef..025671c 100644
void PrintWebViewHelper::OnInitiatePrintPreview(bool has_selection) {
if (ipc_nesting_level_ > 1)
return;
@@ -1388,7 +1372,9 @@ void PrintWebViewHelper::OnInitiatePrintPreview(bool has_selection) {
@@ -1398,7 +1382,9 @@ void PrintWebViewHelper::OnInitiatePrintPreview(bool has_selection) {
// that instead.
auto plugin = delegate_->GetPdfElement(frame);
if (!plugin.isNull()) {
@ -351,7 +351,7 @@ index e343eef..025671c 100644
return;
}
print_preview_context_.InitWithFrame(frame);
@@ -1396,7 +1382,6 @@ void PrintWebViewHelper::OnInitiatePrintPreview(bool has_selection) {
@@ -1406,7 +1392,6 @@ void PrintWebViewHelper::OnInitiatePrintPreview(bool has_selection) {
? PRINT_PREVIEW_USER_INITIATED_SELECTION
: PRINT_PREVIEW_USER_INITIATED_ENTIRE_FRAME);
}
@ -359,10 +359,10 @@ index e343eef..025671c 100644
bool PrintWebViewHelper::IsPrintingEnabled() const {
return is_printing_enabled_;
@@ -1420,11 +1405,9 @@ void PrintWebViewHelper::PrintNode(const blink::WebNode& node) {
@@ -1428,11 +1413,9 @@ void PrintWebViewHelper::PrintNode(const blink::WebNode& node) {
print_node_in_progress_ = true;
// Make a copy of the node, in case RenderView::OnContextMenuClosed resets
// its |context_menu_node_|.
- if (g_is_preview_enabled) {
-#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
+ if (g_is_preview_enabled || force_print_preview_) {
@ -371,8 +371,8 @@ index e343eef..025671c 100644
-#endif
} else {
#if BUILDFLAG(ENABLE_BASIC_PRINTING)
blink::WebNode duplicate_node(node);
@@ -1490,7 +1473,6 @@ void PrintWebViewHelper::DidFinishPrinting(PrintingResult result) {
// Make a copy of the node, in case RenderView::OnContextMenuClosed() resets
@@ -1521,7 +1504,6 @@ void PrintWebViewHelper::DidFinishPrinting(PrintingResult result) {
}
break;
@ -380,7 +380,7 @@ index e343eef..025671c 100644
case FAIL_PREVIEW:
int cookie =
print_pages_params_ ? print_pages_params_->params.document_cookie : 0;
@@ -1502,7 +1484,6 @@ void PrintWebViewHelper::DidFinishPrinting(PrintingResult result) {
@@ -1533,7 +1515,6 @@ void PrintWebViewHelper::DidFinishPrinting(PrintingResult result) {
}
print_preview_context_.Failed(notify_browser_of_print_failure_);
break;
@ -388,7 +388,7 @@ index e343eef..025671c 100644
}
prep_frame_view_.reset();
print_pages_params_.reset();
@@ -1634,7 +1615,6 @@ bool PrintWebViewHelper::CalculateNumberOfPages(blink::WebLocalFrame* frame,
@@ -1665,7 +1646,6 @@ bool PrintWebViewHelper::CalculateNumberOfPages(blink::WebLocalFrame* frame,
return true;
}
@ -396,15 +396,15 @@ index e343eef..025671c 100644
bool PrintWebViewHelper::SetOptionsFromPdfDocument(
PrintHostMsg_SetOptionsFromDocument_Params* options) {
blink::WebLocalFrame* source_frame = print_preview_context_.source_frame();
@@ -1743,7 +1723,6 @@ bool PrintWebViewHelper::UpdatePrintSettings(
return true;
@@ -1772,7 +1752,6 @@ bool PrintWebViewHelper::UpdatePrintSettings(
print_preview_context_.set_error(PREVIEW_ERROR_INVALID_PRINTER_SETTINGS);
return false;
}
-#endif // BUILDFLAG(ENABLE_PRINT_PREVIEW)
#if BUILDFLAG(ENABLE_BASIC_PRINTING)
bool PrintWebViewHelper::GetPrintSettingsFromUser(blink::WebLocalFrame* frame,
@@ -1857,7 +1836,6 @@ void PrintWebViewHelper::PrintPageInternal(
void PrintWebViewHelper::GetPrintSettingsFromUser(
@@ -1879,7 +1858,6 @@ void PrintWebViewHelper::PrintPageInternal(
MetafileSkiaWrapper::SetMetafileOnCanvas(*canvas, metafile);
@ -412,7 +412,7 @@ index e343eef..025671c 100644
if (params.params.display_header_footer) {
// TODO(thestig): Figure out why Linux needs this. It is almost certainly
// |printingMinimumShrinkFactor| from Blink.
@@ -1872,7 +1850,6 @@ void PrintWebViewHelper::PrintPageInternal(
@@ -1894,7 +1872,6 @@ void PrintWebViewHelper::PrintPageInternal(
scale_factor / fudge_factor, page_layout_in_points,
params.params);
}
@ -420,7 +420,7 @@ index e343eef..025671c 100644
float webkit_scale_factor =
RenderPageContent(frame, params.page_number, canvas_area, content_area,
@@ -1908,7 +1885,6 @@ bool PrintWebViewHelper::CopyMetafileDataToSharedMem(
@@ -1930,7 +1907,6 @@ bool PrintWebViewHelper::CopyMetafileDataToSharedMem(
return true;
}
@ -428,7 +428,7 @@ index e343eef..025671c 100644
void PrintWebViewHelper::ShowScriptedPrintPreview() {
if (is_scripted_preview_delayed_) {
is_scripted_preview_delayed_ = false;
@@ -2036,7 +2012,6 @@ bool PrintWebViewHelper::PreviewPageRendered(int page_number,
@@ -2061,7 +2037,6 @@ bool PrintWebViewHelper::PreviewPageRendered(int page_number,
Send(new PrintHostMsg_DidPreviewPage(routing_id(), preview_page_params));
return true;
}
@ -437,10 +437,10 @@ index e343eef..025671c 100644
PrintWebViewHelper::PrintPreviewContext::PrintPreviewContext()
: total_page_count_(0),
diff --git components/printing/renderer/print_web_view_helper.h components/printing/renderer/print_web_view_helper.h
index 2dad908..fea05fd 100644
index 0730f76..645aa81 100644
--- components/printing/renderer/print_web_view_helper.h
+++ components/printing/renderer/print_web_view_helper.h
@@ -143,9 +143,7 @@ class PrintWebViewHelper
@@ -145,9 +145,7 @@ class PrintWebViewHelper
OK,
FAIL_PRINT_INIT,
FAIL_PRINT,
@ -450,7 +450,7 @@ index 2dad908..fea05fd 100644
};
enum PrintPreviewErrorBuckets {
@@ -181,10 +179,8 @@ class PrintWebViewHelper
@@ -183,10 +181,8 @@ class PrintWebViewHelper
void OnPrintForSystemDialog();
void OnPrintForPrintPreview(const base::DictionaryValue& job_settings);
#endif // BUILDFLAG(ENABLE_BASIC_PRINTING)
@ -461,7 +461,7 @@ index 2dad908..fea05fd 100644
void OnPrintingDone(bool success);
// Get |page_size| and |content_area| information from
@@ -197,7 +193,6 @@ class PrintWebViewHelper
@@ -199,7 +195,6 @@ class PrintWebViewHelper
// Update |ignore_css_margins_| based on settings.
void UpdateFrameMarginsCssInfo(const base::DictionaryValue& settings);
@ -469,7 +469,7 @@ index 2dad908..fea05fd 100644
// Prepare frame for creating preview document.
void PrepareFrameForPreviewDocument();
@@ -214,7 +209,6 @@ class PrintWebViewHelper
@@ -216,7 +211,6 @@ class PrintWebViewHelper
// Finalize the print ready preview document.
bool FinalizePrintReadyDocument();
@ -477,7 +477,7 @@ index 2dad908..fea05fd 100644
// Enable/Disable printing.
void OnSetPrintingEnabled(bool enabled);
@@ -242,7 +236,6 @@ class PrintWebViewHelper
@@ -246,7 +240,6 @@ class PrintWebViewHelper
const blink::WebNode& node,
int* number_of_pages);
@ -485,15 +485,15 @@ index 2dad908..fea05fd 100644
// Set options for print preset from source PDF document.
bool SetOptionsFromPdfDocument(
PrintHostMsg_SetOptionsFromDocument_Params* options);
@@ -253,7 +246,6 @@ class PrintWebViewHelper
@@ -257,7 +250,6 @@ class PrintWebViewHelper
bool UpdatePrintSettings(blink::WebLocalFrame* frame,
const blink::WebNode& node,
const base::DictionaryValue& passed_job_settings);
-#endif // BUILDFLAG(ENABLE_PRINT_PREVIEW)
#if BUILDFLAG(ENABLE_BASIC_PRINTING)
// Get final print settings from the user.
// Return false if the user cancels or on error.
@@ -328,7 +320,6 @@ class PrintWebViewHelper
@@ -335,7 +327,6 @@ class PrintWebViewHelper
const PrintMsg_PrintPages_Params& params,
int page_count);
@ -501,7 +501,7 @@ index 2dad908..fea05fd 100644
// Given the |device| and |canvas| to draw on, prints the appropriate headers
// and footers using strings from |header_footer_info| on to the canvas.
static void PrintHeaderAndFooter(blink::WebCanvas* canvas,
@@ -338,7 +329,6 @@ class PrintWebViewHelper
@@ -345,7 +336,6 @@ class PrintWebViewHelper
float webkit_scale_factor,
const PageSizeMargins& page_layout_in_points,
const PrintMsg_Print_Params& params);
@ -509,7 +509,7 @@ index 2dad908..fea05fd 100644
// Script Initiated Printing ------------------------------------------------
@@ -348,7 +338,6 @@ class PrintWebViewHelper
@@ -355,7 +345,6 @@ class PrintWebViewHelper
bool IsScriptInitiatedPrintAllowed(blink::WebFrame* frame,
bool user_initiated);
@ -517,7 +517,7 @@ index 2dad908..fea05fd 100644
// Shows scripted print preview when options from plugin are available.
void ShowScriptedPrintPreview();
@@ -364,7 +353,6 @@ class PrintWebViewHelper
@@ -373,7 +362,6 @@ class PrintWebViewHelper
// |metafile| is the rendered page. Otherwise |metafile| is NULL.
// Returns true if print preview should continue, false on failure.
bool PreviewPageRendered(int page_number, PdfMetafileSkia* metafile);
@ -525,7 +525,7 @@ index 2dad908..fea05fd 100644
void SetPrintPagesParams(const PrintMsg_PrintPages_Params& settings);
@@ -516,6 +504,7 @@ class PrintWebViewHelper
@@ -525,6 +513,7 @@ class PrintWebViewHelper
ScriptingThrottler scripting_throttler_;
bool print_node_in_progress_;

View File

@ -1,5 +1,5 @@
diff --git render_widget_host_view_mac.mm render_widget_host_view_mac.mm
index 689ae2c..52e405d 100644
index 93d929c..249ecd7 100644
--- render_widget_host_view_mac.mm
+++ render_widget_host_view_mac.mm
@@ -462,9 +462,6 @@ RenderWidgetHostViewMac::RenderWidgetHostViewMac(RenderWidgetHost* widget,

View File

@ -351,10 +351,10 @@ index 0dd6715..324fecbc 100644
ui::Window* parent_mus = nullptr;
// Specifies the initial bounds of the Widget. Default is empty, which means
diff --git ui/views/win/hwnd_message_handler.cc ui/views/win/hwnd_message_handler.cc
index 6f80d3e..9a21157 100644
index a15ec1a..9a8697b 100644
--- ui/views/win/hwnd_message_handler.cc
+++ ui/views/win/hwnd_message_handler.cc
@@ -2508,8 +2508,12 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message,
@@ -2516,8 +2516,12 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message,
active_mouse_tracking_flags_ = 0;
} else if (event.type() == ui::ET_MOUSEWHEEL) {
// Reroute the mouse wheel to the window under the pointer if applicable.

View File

@ -74,7 +74,7 @@ index 6cdff54..0efcaa2 100644
int opener_render_process_id,
int opener_render_frame_id,
diff --git content/browser/web_contents/web_contents_impl.cc content/browser/web_contents/web_contents_impl.cc
index a662439..2b22f27 100644
index 5b98a03..ddd9675 100644
--- content/browser/web_contents/web_contents_impl.cc
+++ content/browser/web_contents/web_contents_impl.cc
@@ -1572,6 +1572,12 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {

View File

@ -1,8 +1,8 @@
diff --git Source/web/ChromeClientImpl.cpp Source/web/ChromeClientImpl.cpp
index 0f7c13c..9fac7a7 100644
index 4cf0fe7..404afc2 100644
--- Source/web/ChromeClientImpl.cpp
+++ Source/web/ChromeClientImpl.cpp
@@ -892,7 +892,7 @@ bool ChromeClientImpl::hasOpenedPopup() const {
@@ -886,7 +886,7 @@ bool ChromeClientImpl::hasOpenedPopup() const {
PopupMenu* ChromeClientImpl::openPopupMenu(LocalFrame& frame,
HTMLSelectElement& select) {
notifyPopupOpeningObservers();
@ -12,10 +12,10 @@ index 0f7c13c..9fac7a7 100644
DCHECK(RuntimeEnabledFeatures::pagePopupEnabled());
diff --git Source/web/WebViewImpl.cpp Source/web/WebViewImpl.cpp
index 1330049..66205a3 100644
index fd45686..6e8d82f 100644
--- Source/web/WebViewImpl.cpp
+++ Source/web/WebViewImpl.cpp
@@ -359,6 +359,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client,
@@ -358,6 +358,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client,
m_enableFakePageScaleAnimationForTesting(false),
m_fakePageScaleAnimationPageScaleFactor(0),
m_fakePageScaleAnimationUseAnchor(false),
@ -23,7 +23,7 @@ index 1330049..66205a3 100644
m_ignoreInputEvents(false),
m_compositorDeviceScaleFactorOverride(0),
m_suppressNextKeypressEvent(false),
@@ -3708,8 +3709,13 @@ void WebViewImpl::mainFrameScrollOffsetChanged() {
@@ -3707,8 +3708,13 @@ void WebViewImpl::mainFrameScrollOffsetChanged() {
m_devToolsEmulator->mainFrameScrollOrScaleChanged();
}

View File

@ -1,16 +1,16 @@
diff --git chrome/app/generated_resources.grd chrome/app/generated_resources.grd
index 4206b74..5d6af4c 100644
index 54b8ced..aca718b 100644
--- chrome/app/generated_resources.grd
+++ chrome/app/generated_resources.grd
@@ -7199,7 +7199,7 @@ Keep your key file in a safe place. You will need it to create new versions of y
@@ -7196,7 +7196,7 @@ Keep your key file in a safe place. You will need it to create new versions of y
</message>
</if>
<message name="IDS_PLUGIN_BLOCKED_BY_POLICY" desc="The placeholder text for a plugin blocked by enterprise policy.">
- <ph name="PLUGIN_NAME">$1<ex>Flash</ex></ph> is blocked by enterprise policy
+ <ph name="PLUGIN_NAME">$1<ex>Flash</ex></ph> is not allowed
</message>
<if expr="chromeos">
<message name="IDS_NACL_PLUGIN_BLOCKED" desc="The placeholder text for a blocked plugin.">
<message name="IDS_PLUGIN_BLOCKED_NO_LOADING" desc="The placeholder text for a blocked plugin that cannot be manually loaded by the user.">
<ph name="PLUGIN_NAME">$1<ex>Flash</ex></ph> is blocked
diff --git components/plugins/renderer/loadable_plugin_placeholder.cc components/plugins/renderer/loadable_plugin_placeholder.cc
index 1f38fdb..03e0f60 100644
--- components/plugins/renderer/loadable_plugin_placeholder.cc

View File

@ -439,7 +439,8 @@ class OSRTestHandler : public RoutingTestHandler,
case OSR_TEST_POPUP_SIZE:
EXPECT_EQ(kExpandedSelectRect.x, rect.x);
EXPECT_EQ(kExpandedSelectRect.y, rect.y);
EXPECT_EQ(kExpandedSelectRect.width, rect.width);
if (ExpectComputedPopupWidth())
EXPECT_EQ(kExpandedSelectRect.width, rect.width);
EXPECT_EQ(kExpandedSelectRect.height, rect.height);
DestroySucceededTestSoon();
break;
@ -460,7 +461,8 @@ class OSRTestHandler : public RoutingTestHandler,
EXPECT_EQ(GetScaledInt(kOsrHeight), height);
} else if (type == PET_POPUP) {
const CefRect& expanded_select_rect = GetScaledRect(kExpandedSelectRect);
EXPECT_EQ(expanded_select_rect.width, width);
if (ExpectComputedPopupWidth())
EXPECT_EQ(expanded_select_rect.width, width);
EXPECT_EQ(expanded_select_rect.height, height);
}
@ -703,10 +705,12 @@ class OSRTestHandler : public RoutingTestHandler,
EXPECT_EQ(dirtyRects.size(), 1U);
const CefRect& expanded_select_rect =
GetScaledRect(kExpandedSelectRect);
EXPECT_EQ(dirtyRects[0],
CefRect(0, 0,
expanded_select_rect.width,
expanded_select_rect.height));
EXPECT_EQ(0, dirtyRects[0].x);
EXPECT_EQ(0, dirtyRects[0].y);
if (ExpectComputedPopupWidth())
EXPECT_EQ(expanded_select_rect.width, dirtyRects[0].width);
EXPECT_EQ(expanded_select_rect.height, dirtyRects[0].height);
// first pixel of border
#if defined(OS_MACOSX)
EXPECT_EQ(0xff5d99d6, *(reinterpret_cast<const uint32*>(buffer)));
@ -719,7 +723,8 @@ class OSRTestHandler : public RoutingTestHandler,
#else
#error "Unsupported platform"
#endif
EXPECT_EQ(expanded_select_rect.width, width);
if (ExpectComputedPopupWidth())
EXPECT_EQ(expanded_select_rect.width, width);
EXPECT_EQ(expanded_select_rect.height, height);
DestroySucceededTestSoon();
}
@ -743,11 +748,11 @@ class OSRTestHandler : public RoutingTestHandler,
const CefRect& expanded_select_rect =
GetScaledRect(kExpandedSelectRect);
EXPECT_EQ(dirtyRects.size(), 1U);
EXPECT_EQ(dirtyRects[0],
CefRect(0,
0,
expanded_select_rect.width,
expanded_select_rect.height));
EXPECT_EQ(0, dirtyRects[0].x);
EXPECT_EQ(0, dirtyRects[0].y);
if (ExpectComputedPopupWidth())
EXPECT_EQ(expanded_select_rect.width, dirtyRects[0].width);
EXPECT_EQ(expanded_select_rect.height, dirtyRects[0].height);
DestroySucceededTestSoon();
}
}
@ -1132,6 +1137,19 @@ class OSRTestHandler : public RoutingTestHandler,
return rect.y + rect.height / 2;
}
bool ExpectComputedPopupWidth() const {
#if defined(OS_WIN)
// On Windows the device scale factor is ignored in Blink when computing
// the default form control font size (see https://crbug.com/674663#c11).
// This results in better font size display but also means that we won't
// get the expected (scaled) width value for non-1.0 scale factor select
// popups.
return scale_factor_ == 1.0;
#else
return true;
#endif
}
void DestroySucceededTestSoon() {
if (succeeded())
return;