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 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
516 params.viewSize.height = height; | 516 params.viewSize.height = height; |
517 params.deviceScaleFactor = dpr; | 517 params.deviceScaleFactor = dpr; |
518 view()->OnEnableDeviceEmulation(params); | 518 view()->OnEnableDeviceEmulation(params); |
519 EXPECT_TRUE(ExecuteJavaScriptAndReturnIntValue(get_width, &emulated_width)); | 519 EXPECT_TRUE(ExecuteJavaScriptAndReturnIntValue(get_width, &emulated_width)); |
520 EXPECT_EQ(width, emulated_width); | 520 EXPECT_EQ(width, emulated_width); |
521 EXPECT_TRUE(ExecuteJavaScriptAndReturnIntValue(get_height, | 521 EXPECT_TRUE(ExecuteJavaScriptAndReturnIntValue(get_height, |
522 &emulated_height)); | 522 &emulated_height)); |
523 EXPECT_EQ(height, emulated_height); | 523 EXPECT_EQ(height, emulated_height); |
524 EXPECT_TRUE(ExecuteJavaScriptAndReturnIntValue(get_dpr, &emulated_dpr)); | 524 EXPECT_TRUE(ExecuteJavaScriptAndReturnIntValue(get_dpr, &emulated_dpr)); |
525 EXPECT_EQ(static_cast<int>(dpr * 10), emulated_dpr); | 525 EXPECT_EQ(static_cast<int>(dpr * 10), emulated_dpr); |
526 EXPECT_EQ(compositor_dsf, | 526 EXPECT_EQ(compositor_dsf, view() |
527 view()->compositor()->layer_tree_host()->device_scale_factor()); | 527 ->compositor() |
| 528 ->layer_tree_host() |
| 529 ->GetLayerTree() |
| 530 ->device_scale_factor()); |
528 } | 531 } |
529 }; | 532 }; |
530 | 533 |
531 // Ensure that the main RenderFrame is deleted and cleared from the RenderView | 534 // Ensure that the main RenderFrame is deleted and cleared from the RenderView |
532 // after closing it. | 535 // after closing it. |
533 TEST_F(RenderViewImplTest, RenderFrameClearedAfterClose) { | 536 TEST_F(RenderViewImplTest, RenderFrameClearedAfterClose) { |
534 // Create a new main frame RenderFrame so that we don't interfere with the | 537 // Create a new main frame RenderFrame so that we don't interfere with the |
535 // shutdown of frame() in RenderViewTest.TearDown. | 538 // shutdown of frame() in RenderViewTest.TearDown. |
536 blink::WebURLRequest popup_request(GURL("http://foo.com")); | 539 blink::WebURLRequest popup_request(GURL("http://foo.com")); |
537 blink::WebView* new_web_view = view()->createView( | 540 blink::WebView* new_web_view = view()->createView( |
(...skipping 1942 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2480 ExpectPauseAndResume(3); | 2483 ExpectPauseAndResume(3); |
2481 blink::WebScriptSource source2( | 2484 blink::WebScriptSource source2( |
2482 WebString::fromUTF8("function func2() { func1(); }; func2();")); | 2485 WebString::fromUTF8("function func2() { func1(); }; func2();")); |
2483 frame()->GetWebFrame()->executeScriptInIsolatedWorld(17, &source2, 1, 1); | 2486 frame()->GetWebFrame()->executeScriptInIsolatedWorld(17, &source2, 1, 1); |
2484 | 2487 |
2485 EXPECT_FALSE(IsPaused()); | 2488 EXPECT_FALSE(IsPaused()); |
2486 Detach(); | 2489 Detach(); |
2487 } | 2490 } |
2488 | 2491 |
2489 } // namespace content | 2492 } // namespace content |
OLD | NEW |