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 "content/browser/site_per_process_browsertest.h" | 5 #include "content/browser/site_per_process_browsertest.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 1073 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1084 // The precise amount of scroll for the first view position update is not | 1084 // The precise amount of scroll for the first view position update is not |
1085 // deterministic, so this simply verifies that the OOPIF moved from its | 1085 // deterministic, so this simply verifies that the OOPIF moved from its |
1086 // earlier position. | 1086 // earlier position. |
1087 gfx::Rect update_rect = filter->last_rect(); | 1087 gfx::Rect update_rect = filter->last_rect(); |
1088 EXPECT_LT(update_rect.y(), bounds.y() - rwhv_root->GetViewBounds().y()); | 1088 EXPECT_LT(update_rect.y(), bounds.y() - rwhv_root->GetViewBounds().y()); |
1089 } | 1089 } |
1090 | 1090 |
1091 // Test that scrolling a nested out-of-process iframe bubbles unused scroll | 1091 // Test that scrolling a nested out-of-process iframe bubbles unused scroll |
1092 // delta to a parent frame. | 1092 // delta to a parent frame. |
1093 // Flaky: https://crbug.com/627238 | 1093 // Flaky: https://crbug.com/627238 |
1094 IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, | 1094 IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, ScrollBubblingFromOOPIFTest) { |
1095 DISABLED_ScrollBubblingFromOOPIFTest) { | |
1096 GURL main_url(embedded_test_server()->GetURL( | 1095 GURL main_url(embedded_test_server()->GetURL( |
1097 "a.com", "/cross_site_iframe_factory.html?a(b)")); | 1096 "a.com", "/cross_site_iframe_factory.html?a(b)")); |
1098 EXPECT_TRUE(NavigateToURL(shell(), main_url)); | 1097 EXPECT_TRUE(NavigateToURL(shell(), main_url)); |
1099 | 1098 |
1100 // It is safe to obtain the root frame tree node here, as it doesn't change. | 1099 // It is safe to obtain the root frame tree node here, as it doesn't change. |
1101 FrameTreeNode* root = static_cast<WebContentsImpl*>(shell()->web_contents()) | 1100 FrameTreeNode* root = static_cast<WebContentsImpl*>(shell()->web_contents()) |
1102 ->GetFrameTree() | 1101 ->GetFrameTree() |
1103 ->root(); | 1102 ->root(); |
1104 ASSERT_EQ(1U, root->child_count()); | 1103 ASSERT_EQ(1U, root->child_count()); |
1105 | 1104 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1185 while (update_rect.y() > initial_y) { | 1184 while (update_rect.y() > initial_y) { |
1186 base::RunLoop run_loop; | 1185 base::RunLoop run_loop; |
1187 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( | 1186 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( |
1188 FROM_HERE, run_loop.QuitClosure(), TestTimeouts::tiny_timeout()); | 1187 FROM_HERE, run_loop.QuitClosure(), TestTimeouts::tiny_timeout()); |
1189 run_loop.Run(); | 1188 run_loop.Run(); |
1190 update_rect = filter->last_rect(); | 1189 update_rect = filter->last_rect(); |
1191 } | 1190 } |
1192 | 1191 |
1193 filter->Reset(); | 1192 filter->Reset(); |
1194 | 1193 |
| 1194 // TODO(wjmaclean): This is ugly, but it seems that it stops the scroll |
| 1195 // we're about to send from occassionally colliding with the previous |
| 1196 // scroll animation. |
| 1197 { |
| 1198 base::RunLoop run_loop; |
| 1199 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( |
| 1200 FROM_HERE, run_loop.QuitClosure(), TestTimeouts::action_timeout()); |
| 1201 run_loop.Run(); |
| 1202 update_rect = filter->last_rect(); |
| 1203 } |
| 1204 |
1195 // Scroll the parent down again in order to test scroll bubbling from | 1205 // Scroll the parent down again in order to test scroll bubbling from |
1196 // gestures. | 1206 // gestures. |
1197 scroll_event.delta_y = -5.0f; | 1207 scroll_event.delta_y = -5.0f; |
1198 rwhv_parent->ProcessMouseWheelEvent(scroll_event, ui::LatencyInfo()); | 1208 rwhv_parent->ProcessMouseWheelEvent(scroll_event, ui::LatencyInfo()); |
1199 | 1209 |
1200 // Ensure ensuing offset change is received, and then reset the filter. | 1210 // Ensure ensuing offset change is received, and then reset the filter. |
1201 filter->Wait(); | 1211 filter->Wait(); |
1202 filter->Reset(); | 1212 filter->Reset(); |
1203 | 1213 |
1204 // Scroll down the nested iframe via gesture. This requires 3 separate input | 1214 // Scroll down the nested iframe via gesture. This requires 3 separate input |
(...skipping 8656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9861 names.insert(root->children[0]->frame_entry->frame_unique_name()); | 9871 names.insert(root->children[0]->frame_entry->frame_unique_name()); |
9862 } | 9872 } |
9863 | 9873 |
9864 // More than one entry in the set means that the subframe frame navigation | 9874 // More than one entry in the set means that the subframe frame navigation |
9865 // entries didn't have a consistent unique name. This will break history | 9875 // entries didn't have a consistent unique name. This will break history |
9866 // navigations =( | 9876 // navigations =( |
9867 EXPECT_THAT(names, SizeIs(1)) << "Mismatched names for subframe!"; | 9877 EXPECT_THAT(names, SizeIs(1)) << "Mismatched names for subframe!"; |
9868 } | 9878 } |
9869 | 9879 |
9870 } // namespace content | 9880 } // namespace content |
OLD | NEW |