Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(764)

Unified Diff: third_party/WebKit/Source/web/tests/WebViewTest.cpp

Issue 2390923002: Fix blurry content after disabling dev tools emulation (Closed)
Patch Set: Add function for LayerTreeHostRemote Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/web/tests/WebViewTest.cpp
diff --git a/third_party/WebKit/Source/web/tests/WebViewTest.cpp b/third_party/WebKit/Source/web/tests/WebViewTest.cpp
index ce168d153e49f86ce6df90b233579629072c6df9..86cf80e8070dd6f73f33da24254bd968f524a3f7 100644
--- a/third_party/WebKit/Source/web/tests/WebViewTest.cpp
+++ b/third_party/WebKit/Source/web/tests/WebViewTest.cpp
@@ -3962,7 +3962,8 @@ TEST_F(WebViewTest, ForceAndResetViewport) {
TransformationMatrix expectedMatrix;
expectedMatrix.makeIdentity();
- EXPECT_EQ(expectedMatrix, webViewImpl->getRootLayerTransformForTesting());
+ EXPECT_EQ(expectedMatrix,
+ webViewImpl->getDeviceEmulationTransformForTesting());
EXPECT_FALSE(devToolsEmulator->visibleContentRectForPainting());
EXPECT_TRUE(visualViewport->containerLayer()->masksToBounds());
@@ -3970,7 +3971,8 @@ TEST_F(WebViewTest, ForceAndResetViewport) {
// visual viewport clipping.
devToolsEmulator->forceViewport(WebFloatPoint(50, 55), 2.f);
expectedMatrix.makeIdentity().scale(2.f).translate(-50, -55);
- EXPECT_EQ(expectedMatrix, webViewImpl->getRootLayerTransformForTesting());
+ EXPECT_EQ(expectedMatrix,
+ webViewImpl->getDeviceEmulationTransformForTesting());
EXPECT_EQ(IntRect(50, 55, 50, 75),
*devToolsEmulator->visibleContentRectForPainting());
EXPECT_FALSE(visualViewport->containerLayer()->masksToBounds());
@@ -3978,7 +3980,8 @@ TEST_F(WebViewTest, ForceAndResetViewport) {
// Setting new override discards previous one.
devToolsEmulator->forceViewport(WebFloatPoint(5.4f, 10.5f), 1.5f);
expectedMatrix.makeIdentity().scale(1.5f).translate(-5.4f, -10.5f);
- EXPECT_EQ(expectedMatrix, webViewImpl->getRootLayerTransformForTesting());
+ EXPECT_EQ(expectedMatrix,
+ webViewImpl->getDeviceEmulationTransformForTesting());
EXPECT_EQ(IntRect(5, 10, 68, 101),
*devToolsEmulator->visibleContentRectForPainting());
EXPECT_FALSE(visualViewport->containerLayer()->masksToBounds());
@@ -3987,7 +3990,8 @@ TEST_F(WebViewTest, ForceAndResetViewport) {
// visual viewport clipping.
devToolsEmulator->resetViewport();
expectedMatrix.makeIdentity();
- EXPECT_EQ(expectedMatrix, webViewImpl->getRootLayerTransformForTesting());
+ EXPECT_EQ(expectedMatrix,
+ webViewImpl->getDeviceEmulationTransformForTesting());
EXPECT_FALSE(devToolsEmulator->visibleContentRectForPainting());
EXPECT_TRUE(visualViewport->containerLayer()->masksToBounds());
}
@@ -4002,14 +4006,16 @@ TEST_F(WebViewTest, ViewportOverrideIntegratesDeviceMetricsOffsetAndScale) {
TransformationMatrix expectedMatrix;
expectedMatrix.makeIdentity();
- EXPECT_EQ(expectedMatrix, webViewImpl->getRootLayerTransformForTesting());
+ EXPECT_EQ(expectedMatrix,
+ webViewImpl->getDeviceEmulationTransformForTesting());
WebDeviceEmulationParams emulationParams;
emulationParams.offset = WebFloatPoint(50, 50);
emulationParams.scale = 2.f;
webViewImpl->enableDeviceEmulation(emulationParams);
expectedMatrix.makeIdentity().translate(50, 50).scale(2.f);
- EXPECT_EQ(expectedMatrix, webViewImpl->getRootLayerTransformForTesting());
+ EXPECT_EQ(expectedMatrix,
+ webViewImpl->getDeviceEmulationTransformForTesting());
// Device metrics offset and scale are applied before viewport override.
webViewImpl->devToolsEmulator()->forceViewport(WebFloatPoint(5, 10), 1.5f);
@@ -4018,7 +4024,8 @@ TEST_F(WebViewTest, ViewportOverrideIntegratesDeviceMetricsOffsetAndScale) {
.translate(-5, -10)
.translate(50, 50)
.scale(2.f);
- EXPECT_EQ(expectedMatrix, webViewImpl->getRootLayerTransformForTesting());
+ EXPECT_EQ(expectedMatrix,
+ webViewImpl->getDeviceEmulationTransformForTesting());
}
TEST_F(WebViewTest, ViewportOverrideAdaptsToScaleAndScroll) {
@@ -4034,7 +4041,8 @@ TEST_F(WebViewTest, ViewportOverrideAdaptsToScaleAndScroll) {
TransformationMatrix expectedMatrix;
expectedMatrix.makeIdentity();
- EXPECT_EQ(expectedMatrix, webViewImpl->getRootLayerTransformForTesting());
+ EXPECT_EQ(expectedMatrix,
+ webViewImpl->getDeviceEmulationTransformForTesting());
// Initial transform takes current page scale and scroll position into
// account.
@@ -4047,7 +4055,8 @@ TEST_F(WebViewTest, ViewportOverrideAdaptsToScaleAndScroll) {
.translate(-50, -55)
.translate(100, 150)
.scale(1. / 1.5f);
- EXPECT_EQ(expectedMatrix, webViewImpl->getRootLayerTransformForTesting());
+ EXPECT_EQ(expectedMatrix,
+ webViewImpl->getDeviceEmulationTransformForTesting());
// Page scroll and scale are irrelevant for visibleContentRect.
EXPECT_EQ(IntRect(50, 55, 50, 75),
*devToolsEmulator->visibleContentRectForPainting());
@@ -4060,7 +4069,8 @@ TEST_F(WebViewTest, ViewportOverrideAdaptsToScaleAndScroll) {
.translate(-50, -55)
.translate(50, 55)
.scale(1. / 1.5f);
- EXPECT_EQ(expectedMatrix, webViewImpl->getRootLayerTransformForTesting());
+ EXPECT_EQ(expectedMatrix,
+ webViewImpl->getDeviceEmulationTransformForTesting());
// visibleContentRect doesn't change.
EXPECT_EQ(IntRect(50, 55, 50, 75),
*devToolsEmulator->visibleContentRectForPainting());
@@ -4072,7 +4082,8 @@ TEST_F(WebViewTest, ViewportOverrideAdaptsToScaleAndScroll) {
.translate(-50, -55)
.translate(50, 55)
.scale(1. / 2.f);
- EXPECT_EQ(expectedMatrix, webViewImpl->getRootLayerTransformForTesting());
+ EXPECT_EQ(expectedMatrix,
+ webViewImpl->getDeviceEmulationTransformForTesting());
// visibleContentRect doesn't change.
EXPECT_EQ(IntRect(50, 55, 50, 75),
*devToolsEmulator->visibleContentRectForPainting());
« no previous file with comments | « third_party/WebKit/Source/web/WebViewImpl.cpp ('k') | third_party/WebKit/public/platform/WebLayerTreeView.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698