diff options
author | oshima <oshima@chromium.org> | 2015-12-16 14:40:16 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-12-16 22:42:16 +0000 |
commit | 76ebe14aeee04f02c62273c638e110f621c162aa (patch) | |
tree | 88fe36d76b45deb111199594f92b9f7d167581c4 /components/test_runner | |
parent | 3b4338fc32cf20703baa8066bdad7ce07c5ae696 (diff) | |
download | chromium_src-76ebe14aeee04f02c62273c638e110f621c162aa.zip chromium_src-76ebe14aeee04f02c62273c638e110f621c162aa.tar.gz chromium_src-76ebe14aeee04f02c62273c638e110f621c162aa.tar.bz2 |
Support device scale factor test with popups in LayoutTest
* Sends DSF to host so that host can send a resize request with requested DSF.
* Updated X11's screen so that displays contains specified DSF.
This is used by RWH to construct WebScreenInfo with updated DSF.
- Win/Mac will use the DSF specified by command line flag.
* Scale the popup location based on the device scale factor.
This is done by compositor in normal scenario.
BUG=567837
TEST=added popu-menu-appearance-dsf2.html
Review URL: https://codereview.chromium.org/1525933002
Cr-Commit-Position: refs/heads/master@{#365647}
Diffstat (limited to 'components/test_runner')
-rw-r--r-- | components/test_runner/web_test_delegate.h | 5 | ||||
-rw-r--r-- | components/test_runner/web_test_proxy.cc | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/components/test_runner/web_test_delegate.h b/components/test_runner/web_test_delegate.h index 753831d..d9881f6 100644 --- a/components/test_runner/web_test_delegate.h +++ b/components/test_runner/web_test_delegate.h @@ -30,6 +30,7 @@ class WebLocalFrame; class WebMediaStream; class WebPlugin; struct WebPluginParams; +struct WebPoint; struct WebRect; struct WebSize; struct WebURLError; @@ -280,6 +281,10 @@ class WebTestDelegate { const blink::WebPluginParams& params) = 0; virtual void OnWebTestProxyBaseDestroy(WebTestProxyBase* proxy) = 0; + + // Convert the position in DIP to native coordinates. + virtual blink::WebPoint ConvertDIPToNative( + const blink::WebPoint& point_in_dip) const = 0; }; } // namespace test_runner diff --git a/components/test_runner/web_test_proxy.cc b/components/test_runner/web_test_proxy.cc index 44a1fc9..90c6c46 100644 --- a/components/test_runner/web_test_proxy.cc +++ b/components/test_runner/web_test_proxy.cc @@ -670,7 +670,8 @@ void WebTestProxyBase::CapturePixelsAsync( web_widget_->compositeAndReadbackAsync(capture_callback); if (blink::WebPagePopup* popup = web_widget_->pagePopup()) { capture_callback->set_wait_for_popup(true); - capture_callback->set_popup_position(popup->positionRelativeToOwner()); + capture_callback->set_popup_position( + delegate_->ConvertDIPToNative(popup->positionRelativeToOwner())); popup->compositeAndReadbackAsync(capture_callback); } } |