| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 #include <tuple> | 7 #include <tuple> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 2260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2271 EXPECT_FALSE(settings()->multiTargetTapNotificationEnabled()); | 2271 EXPECT_FALSE(settings()->multiTargetTapNotificationEnabled()); |
| 2272 EXPECT_TRUE(settings()->viewportEnabled()); | 2272 EXPECT_TRUE(settings()->viewportEnabled()); |
| 2273 } | 2273 } |
| 2274 | 2274 |
| 2275 TEST_F(RenderViewImplScaleFactorTest, ConverViewportToWindowWithoutZoomForDSF) { | 2275 TEST_F(RenderViewImplScaleFactorTest, ConverViewportToWindowWithoutZoomForDSF) { |
| 2276 DoSetUp(); | 2276 DoSetUp(); |
| 2277 if (IsUseZoomForDSFEnabled()) | 2277 if (IsUseZoomForDSFEnabled()) |
| 2278 return; | 2278 return; |
| 2279 SetDeviceScaleFactor(2.f); | 2279 SetDeviceScaleFactor(2.f); |
| 2280 blink::WebRect rect(20, 10, 200, 100); | 2280 blink::WebRect rect(20, 10, 200, 100); |
| 2281 view()->convertViewportToWindow(&rect); | 2281 view()->GetWidget()->convertViewportToWindow(&rect); |
| 2282 EXPECT_EQ(20, rect.x); | 2282 EXPECT_EQ(20, rect.x); |
| 2283 EXPECT_EQ(10, rect.y); | 2283 EXPECT_EQ(10, rect.y); |
| 2284 EXPECT_EQ(200, rect.width); | 2284 EXPECT_EQ(200, rect.width); |
| 2285 EXPECT_EQ(100, rect.height); | 2285 EXPECT_EQ(100, rect.height); |
| 2286 } | 2286 } |
| 2287 | 2287 |
| 2288 TEST_F(RenderViewImplScaleFactorTest, ScreenMetricsEmulationWithOriginalDSF1) { | 2288 TEST_F(RenderViewImplScaleFactorTest, ScreenMetricsEmulationWithOriginalDSF1) { |
| 2289 DoSetUp(); | 2289 DoSetUp(); |
| 2290 SetDeviceScaleFactor(1.f); | 2290 SetDeviceScaleFactor(1.f); |
| 2291 | 2291 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2345 // Don't disable here to test that emulation is being shutdown properly. | 2345 // Don't disable here to test that emulation is being shutdown properly. |
| 2346 } | 2346 } |
| 2347 | 2347 |
| 2348 TEST_F(RenderViewImplScaleFactorTest, ConverViewportToWindowWithZoomForDSF) { | 2348 TEST_F(RenderViewImplScaleFactorTest, ConverViewportToWindowWithZoomForDSF) { |
| 2349 base::CommandLine::ForCurrentProcess()->AppendSwitch( | 2349 base::CommandLine::ForCurrentProcess()->AppendSwitch( |
| 2350 switches::kEnableUseZoomForDSF); | 2350 switches::kEnableUseZoomForDSF); |
| 2351 DoSetUp(); | 2351 DoSetUp(); |
| 2352 SetDeviceScaleFactor(1.f); | 2352 SetDeviceScaleFactor(1.f); |
| 2353 { | 2353 { |
| 2354 blink::WebRect rect(20, 10, 200, 100); | 2354 blink::WebRect rect(20, 10, 200, 100); |
| 2355 view()->convertViewportToWindow(&rect); | 2355 view()->GetWidget()->convertViewportToWindow(&rect); |
| 2356 EXPECT_EQ(20, rect.x); | 2356 EXPECT_EQ(20, rect.x); |
| 2357 EXPECT_EQ(10, rect.y); | 2357 EXPECT_EQ(10, rect.y); |
| 2358 EXPECT_EQ(200, rect.width); | 2358 EXPECT_EQ(200, rect.width); |
| 2359 EXPECT_EQ(100, rect.height); | 2359 EXPECT_EQ(100, rect.height); |
| 2360 } | 2360 } |
| 2361 | 2361 |
| 2362 SetDeviceScaleFactor(2.f); | 2362 SetDeviceScaleFactor(2.f); |
| 2363 { | 2363 { |
| 2364 blink::WebRect rect(20, 10, 200, 100); | 2364 blink::WebRect rect(20, 10, 200, 100); |
| 2365 view()->convertViewportToWindow(&rect); | 2365 view()->GetWidget()->convertViewportToWindow(&rect); |
| 2366 EXPECT_EQ(10, rect.x); | 2366 EXPECT_EQ(10, rect.x); |
| 2367 EXPECT_EQ(5, rect.y); | 2367 EXPECT_EQ(5, rect.y); |
| 2368 EXPECT_EQ(100, rect.width); | 2368 EXPECT_EQ(100, rect.width); |
| 2369 EXPECT_EQ(50, rect.height); | 2369 EXPECT_EQ(50, rect.height); |
| 2370 } | 2370 } |
| 2371 } | 2371 } |
| 2372 | 2372 |
| 2373 #if defined(OS_MACOSX) || defined(USE_AURA) | 2373 #if defined(OS_MACOSX) || defined(USE_AURA) |
| 2374 TEST_F(RenderViewImplScaleFactorTest, | 2374 TEST_F(RenderViewImplScaleFactorTest, |
| 2375 DISABLED_GetCompositionCharacterBoundsTest) { // http://crbug.com/582016 | 2375 DISABLED_GetCompositionCharacterBoundsTest) { // http://crbug.com/582016 |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2556 ExpectPauseAndResume(3); | 2556 ExpectPauseAndResume(3); |
| 2557 blink::WebScriptSource source2( | 2557 blink::WebScriptSource source2( |
| 2558 WebString::fromUTF8("function func2() { func1(); }; func2();")); | 2558 WebString::fromUTF8("function func2() { func1(); }; func2();")); |
| 2559 frame()->GetWebFrame()->executeScriptInIsolatedWorld(17, &source2, 1, 1); | 2559 frame()->GetWebFrame()->executeScriptInIsolatedWorld(17, &source2, 1, 1); |
| 2560 | 2560 |
| 2561 EXPECT_FALSE(IsPaused()); | 2561 EXPECT_FALSE(IsPaused()); |
| 2562 Detach(); | 2562 Detach(); |
| 2563 } | 2563 } |
| 2564 | 2564 |
| 2565 } // namespace content | 2565 } // namespace content |
| OLD | NEW |