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

Side by Side Diff: Source/web/tests/ScrollingCoordinatorChromiumTest.cpp

Issue 564043003: Add a setting to disable threaded scrolling (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: s/accelerated/threaded/ Created 6 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 unified diff | Download patch
« no previous file with comments | « Source/web/WebSettingsImpl.cpp ('k') | public/web/WebSettings.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 ASSERT_TRUE(page->scrollingCoordinator()); 117 ASSERT_TRUE(page->scrollingCoordinator());
118 ASSERT_TRUE(page->scrollingCoordinator()->coordinatesScrollingForFrameView(f rameView)); 118 ASSERT_TRUE(page->scrollingCoordinator()->coordinatesScrollingForFrameView(f rameView));
119 119
120 // Fast scrolling should be enabled by default. 120 // Fast scrolling should be enabled by default.
121 WebLayer* rootScrollLayer = getRootScrollLayer(); 121 WebLayer* rootScrollLayer = getRootScrollLayer();
122 ASSERT_TRUE(rootScrollLayer->scrollable()); 122 ASSERT_TRUE(rootScrollLayer->scrollable());
123 ASSERT_FALSE(rootScrollLayer->shouldScrollOnMainThread()); 123 ASSERT_FALSE(rootScrollLayer->shouldScrollOnMainThread());
124 ASSERT_FALSE(rootScrollLayer->haveWheelEventHandlers()); 124 ASSERT_FALSE(rootScrollLayer->haveWheelEventHandlers());
125 } 125 }
126 126
127 TEST_F(ScrollingCoordinatorChromiumTest, fastScrollingCanBeDisabledWithSetting)
128 {
129 navigateTo("about:blank");
130 webViewImpl()->settings()->setThreadedScrollingEnabled(false);
131 forceFullCompositingUpdate();
132
133 // Make sure the scrolling coordinator is active.
134 FrameView* frameView = frame()->view();
135 Page* page = frame()->page();
136 ASSERT_TRUE(page->scrollingCoordinator());
137 ASSERT_TRUE(page->scrollingCoordinator()->coordinatesScrollingForFrameView(f rameView));
138
139 // Main scrolling should be enabled with the setting override.
140 WebLayer* rootScrollLayer = getRootScrollLayer();
141 ASSERT_TRUE(rootScrollLayer->scrollable());
142 ASSERT_TRUE(rootScrollLayer->shouldScrollOnMainThread());
143 }
144
127 static WebLayer* webLayerFromElement(Element* element) 145 static WebLayer* webLayerFromElement(Element* element)
128 { 146 {
129 if (!element) 147 if (!element)
130 return 0; 148 return 0;
131 RenderObject* renderer = element->renderer(); 149 RenderObject* renderer = element->renderer();
132 if (!renderer || !renderer->isBoxModelObject()) 150 if (!renderer || !renderer->isBoxModelObject())
133 return 0; 151 return 0;
134 RenderLayer* layer = toRenderBoxModelObject(renderer)->layer(); 152 RenderLayer* layer = toRenderBoxModelObject(renderer)->layer();
135 if (!layer) 153 if (!layer)
136 return 0; 154 return 0;
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 TEST_F(ScrollingCoordinatorChromiumTest, setupScrollbarLayerShouldNotCrash) 468 TEST_F(ScrollingCoordinatorChromiumTest, setupScrollbarLayerShouldNotCrash)
451 { 469 {
452 registerMockedHttpURLLoad("setup_scrollbar_layer_crash.html"); 470 registerMockedHttpURLLoad("setup_scrollbar_layer_crash.html");
453 navigateTo(m_baseURL + "setup_scrollbar_layer_crash.html"); 471 navigateTo(m_baseURL + "setup_scrollbar_layer_crash.html");
454 forceFullCompositingUpdate(); 472 forceFullCompositingUpdate();
455 // This test document setup an iframe with scrollbars, then switch to 473 // This test document setup an iframe with scrollbars, then switch to
456 // an empty document by javascript. 474 // an empty document by javascript.
457 } 475 }
458 476
459 } // namespace 477 } // namespace
OLDNEW
« no previous file with comments | « Source/web/WebSettingsImpl.cpp ('k') | public/web/WebSettings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698