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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/bind.h" | 6 #include "base/bind.h" |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
(...skipping 939 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
950 new_main_frame->SwapOut(kProxyRoutingId, true, | 950 new_main_frame->SwapOut(kProxyRoutingId, true, |
951 content::FrameReplicationState()); | 951 content::FrameReplicationState()); |
952 | 952 |
953 // Simulate getting painted after swapping out. | 953 // Simulate getting painted after swapping out. |
954 new_view->DidFlushPaint(); | 954 new_view->DidFlushPaint(); |
955 | 955 |
956 new_view->Close(); | 956 new_view->Close(); |
957 new_view->Release(); | 957 new_view->Release(); |
958 } | 958 } |
959 | 959 |
| 960 TEST_F(RenderViewImplTest, SetZoomLevelAfterCrossProcessNavigation) { |
| 961 // This test should only run with out-of-process iframes enabled. |
| 962 if (!SiteIsolationPolicy::AreCrossProcessFramesPossible()) |
| 963 return; |
| 964 |
| 965 LoadHTML("Hello world!"); |
| 966 |
| 967 // Swap the main frame out after which it should become a WebRemoteFrame. |
| 968 TestRenderFrame* main_frame = |
| 969 static_cast<TestRenderFrame*>(view()->GetMainRenderFrame()); |
| 970 main_frame->SwapOut(kProxyRoutingId, true, content::FrameReplicationState()); |
| 971 EXPECT_TRUE(view()->webview()->mainFrame()->isWebRemoteFrame()); |
| 972 |
| 973 // This should not cause a crash. |
| 974 view()->OnDeviceScaleFactorChanged(); |
| 975 } |
| 976 |
960 // Test that we get the correct UpdateState message when we go back twice | 977 // Test that we get the correct UpdateState message when we go back twice |
961 // quickly without committing. Regression test for http://crbug.com/58082. | 978 // quickly without committing. Regression test for http://crbug.com/58082. |
962 // Disabled: http://crbug.com/157357 . | 979 // Disabled: http://crbug.com/157357 . |
963 TEST_F(RenderViewImplTest, DISABLED_LastCommittedUpdateState) { | 980 TEST_F(RenderViewImplTest, DISABLED_LastCommittedUpdateState) { |
964 // Load page A. | 981 // Load page A. |
965 LoadHTML("<div>Page A</div>"); | 982 LoadHTML("<div>Page A</div>"); |
966 | 983 |
967 // Load page B, which will trigger an UpdateState message for page A. | 984 // Load page B, which will trigger an UpdateState message for page A. |
968 LoadHTML("<div>Page B</div>"); | 985 LoadHTML("<div>Page B</div>"); |
969 | 986 |
(...skipping 1736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2706 FROM_HERE, | 2723 FROM_HERE, |
2707 base::Bind(&DevToolsAgentTest::CloseWhilePaused, base::Unretained(this))); | 2724 base::Bind(&DevToolsAgentTest::CloseWhilePaused, base::Unretained(this))); |
2708 ExecuteJavaScriptForTests("debugger;"); | 2725 ExecuteJavaScriptForTests("debugger;"); |
2709 | 2726 |
2710 // CloseWhilePaused should resume execution and continue here. | 2727 // CloseWhilePaused should resume execution and continue here. |
2711 EXPECT_FALSE(IsPaused()); | 2728 EXPECT_FALSE(IsPaused()); |
2712 Detach(); | 2729 Detach(); |
2713 } | 2730 } |
2714 | 2731 |
2715 } // namespace content | 2732 } // namespace content |
OLD | NEW |