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

Side by Side Diff: content/browser/site_per_process_browsertest.cc

Issue 2785533003: Animated scroll shouldn't consume unhandled scrolls for OOPIFs. (Closed)
Patch Set: Disable scroll bubbling test on Android. Created 3 years, 8 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 unified diff | Download patch
OLDNEW
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 1072 matching lines...) Expand 10 before | Expand all | Expand 10 after
1083 1083
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
bokan 2017/04/11 22:18:29 If this used to be flaky, it means the functionali
wjmaclean 2017/04/12 15:54:47 Yes and no. :-)
1094 #if defined(OS_ANDROID)
1095 // Test failing on some Android builders, due to inaccurate coordinates on
1096 // some devices. See: https://crbug.com/700007.
1097 #define MAYBE_ScrollBubblingFromOOPIFTest DISABLED_ScrollBubblingFromOOPIFTest
1098 #else
1099 #define MAYBE_ScrollBubblingFromOOPIFTest ScrollBubblingFromOOPIFTest
1100 #endif
1094 IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, 1101 IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest,
1095 DISABLED_ScrollBubblingFromOOPIFTest) { 1102 MAYBE_ScrollBubblingFromOOPIFTest) {
1096 GURL main_url(embedded_test_server()->GetURL( 1103 GURL main_url(embedded_test_server()->GetURL(
1097 "a.com", "/cross_site_iframe_factory.html?a(b)")); 1104 "a.com", "/cross_site_iframe_factory.html?a(b)"));
1098 EXPECT_TRUE(NavigateToURL(shell(), main_url)); 1105 EXPECT_TRUE(NavigateToURL(shell(), main_url));
1099 1106
1100 // It is safe to obtain the root frame tree node here, as it doesn't change. 1107 // 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()) 1108 FrameTreeNode* root = static_cast<WebContentsImpl*>(shell()->web_contents())
1102 ->GetFrameTree() 1109 ->GetFrameTree()
1103 ->root(); 1110 ->root();
1104 ASSERT_EQ(1U, root->child_count()); 1111 ASSERT_EQ(1U, root->child_count());
1105 1112
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
1185 while (update_rect.y() > initial_y) { 1192 while (update_rect.y() > initial_y) {
1186 base::RunLoop run_loop; 1193 base::RunLoop run_loop;
1187 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( 1194 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
1188 FROM_HERE, run_loop.QuitClosure(), TestTimeouts::tiny_timeout()); 1195 FROM_HERE, run_loop.QuitClosure(), TestTimeouts::tiny_timeout());
1189 run_loop.Run(); 1196 run_loop.Run();
1190 update_rect = filter->last_rect(); 1197 update_rect = filter->last_rect();
1191 } 1198 }
1192 1199
1193 filter->Reset(); 1200 filter->Reset();
1194 1201
1202 // TODO(wjmaclean): This is ugly, but it seems that it stops the scroll
1203 // we're about to send from occassionally colliding with the previous
1204 // scroll animation.
1205 {
1206 base::RunLoop run_loop;
1207 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
1208 FROM_HERE, run_loop.QuitClosure(), TestTimeouts::action_max_timeout());
1209 run_loop.Run();
1210 update_rect = filter->last_rect();
1211 }
1212
1195 // Scroll the parent down again in order to test scroll bubbling from 1213 // Scroll the parent down again in order to test scroll bubbling from
1196 // gestures. 1214 // gestures.
1197 scroll_event.delta_y = -5.0f; 1215 scroll_event.delta_y = -5.0f;
1198 rwhv_parent->ProcessMouseWheelEvent(scroll_event, ui::LatencyInfo()); 1216 rwhv_parent->ProcessMouseWheelEvent(scroll_event, ui::LatencyInfo());
1199 1217
1200 // Ensure ensuing offset change is received, and then reset the filter. 1218 // Ensure ensuing offset change is received, and then reset the filter.
1201 filter->Wait(); 1219 filter->Wait();
1202 filter->Reset(); 1220 filter->Reset();
1203 1221
1204 // Scroll down the nested iframe via gesture. This requires 3 separate input 1222 // Scroll down the nested iframe via gesture. This requires 3 separate input
(...skipping 8656 matching lines...) Expand 10 before | Expand all | Expand 10 after
9861 names.insert(root->children[0]->frame_entry->frame_unique_name()); 9879 names.insert(root->children[0]->frame_entry->frame_unique_name());
9862 } 9880 }
9863 9881
9864 // More than one entry in the set means that the subframe frame navigation 9882 // 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 9883 // entries didn't have a consistent unique name. This will break history
9866 // navigations =( 9884 // navigations =(
9867 EXPECT_THAT(names, SizeIs(1)) << "Mismatched names for subframe!"; 9885 EXPECT_THAT(names, SizeIs(1)) << "Mismatched names for subframe!";
9868 } 9886 }
9869 9887
9870 } // namespace content 9888 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698