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

Unified Diff: chrome/browser/apps/guest_view/web_view_browsertest.cc

Issue 1377173005: Make sure fast-path scrolls bubble on non-scrollable guest. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix comment. Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/test/data/extensions/platform_apps/web_view/scrollable_embedder_and_guest/guest.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/apps/guest_view/web_view_browsertest.cc
diff --git a/chrome/browser/apps/guest_view/web_view_browsertest.cc b/chrome/browser/apps/guest_view/web_view_browsertest.cc
index 478b3d19b50459f3bacb07d59f10bca0343779d0..e07f46a9b51d7c9f7eacebfcc91a1ec2c444e304 100644
--- a/chrome/browser/apps/guest_view/web_view_browsertest.cc
+++ b/chrome/browser/apps/guest_view/web_view_browsertest.cc
@@ -2517,7 +2517,17 @@ IN_PROC_BROWSER_TEST_F(WebViewTest, LoadWebviewAccessibleResource) {
"web_view/load_webview_accessible_resource", NEEDS_TEST_SERVER);
}
-class WebViewTouchTest : public WebViewTest {
+class WebViewGuestScrollTest : public WebViewTest,
+ public ::testing::WithParamInterface<bool> {
+ protected:
+ WebViewGuestScrollTest() {}
+ ~WebViewGuestScrollTest() {}
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(WebViewGuestScrollTest);
+};
+
+class WebViewGuestScrollTouchTest : public WebViewGuestScrollTest {
protected:
void SetUpCommandLine(base::CommandLine* command_line) override {
command_line->AppendSwitchASCII(switches::kTouchEvents,
@@ -2547,9 +2557,19 @@ class ScrollWaiter {
} // namespace
// Tests that scrolls bubble from guest to embedder.
-IN_PROC_BROWSER_TEST_F(WebViewTest, TestGuestWheelScrollsBubble) {
+// Create two test instances, one where the guest body is scrollable and the
+// other where the body is not scrollable: fast-path scrolling will generate
+// different ack results in between these two cases.
+INSTANTIATE_TEST_CASE_P(WebViewScrollBubbling,
+ WebViewGuestScrollTest,
+ ::testing::Bool());
+
+IN_PROC_BROWSER_TEST_P(WebViewGuestScrollTest, TestGuestWheelScrollsBubble) {
LoadAppWithGuest("web_view/scrollable_embedder_and_guest");
+ if (GetParam())
+ SendMessageToGuestAndWait("set_overflow_hidden", "overflow_is_hidden");
+
content::WebContents* embedder_contents = GetEmbedderWebContents();
std::vector<content::WebContents*> guest_web_contents_list;
@@ -2621,7 +2641,12 @@ IN_PROC_BROWSER_TEST_F(WebViewTest, TestGuestWheelScrollsBubble) {
}
}
-IN_PROC_BROWSER_TEST_F(WebViewTouchTest, TestGuestGestureScrollsBubble) {
+INSTANTIATE_TEST_CASE_P(WebViewScrollBubbling,
+ WebViewGuestScrollTouchTest,
+ ::testing::Bool());
+
+IN_PROC_BROWSER_TEST_P(WebViewGuestScrollTouchTest,
+ TestGuestGestureScrollsBubble) {
// Just in case we're running ChromeOS tests, we need to make sure the
// debounce interval is set to zero so our back-to-back gesture-scrolls don't
// get munged together. Since the first scroll will be put on the fast
@@ -2633,6 +2658,9 @@ IN_PROC_BROWSER_TEST_F(WebViewTouchTest, TestGuestGestureScrollsBubble) {
LoadAppWithGuest("web_view/scrollable_embedder_and_guest");
+ if (GetParam())
+ SendMessageToGuestAndWait("set_overflow_hidden", "overflow_is_hidden");
+
content::WebContents* embedder_contents = GetEmbedderWebContents();
std::vector<content::WebContents*> guest_web_contents_list;
« no previous file with comments | « no previous file | chrome/test/data/extensions/platform_apps/web_view/scrollable_embedder_and_guest/guest.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698