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

Unified Diff: cc/layer_tree_host_unittest_scroll.cc

Issue 11662003: cc: Put context-loss tests in layer_tree_host_unittest_context.cc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 80cols Created 7 years, 12 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 | « cc/layer_tree_host_unittest_context.cc ('k') | cc/resource_provider_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layer_tree_host_unittest_scroll.cc
diff --git a/cc/layer_tree_host_unittest_scroll.cc b/cc/layer_tree_host_unittest_scroll.cc
index 15ab63b17e7a391ed5c300e52b326e7fa42690c3..8b82414c387277514e8f68ece8335fdcc3425ecc 100644
--- a/cc/layer_tree_host_unittest_scroll.cc
+++ b/cc/layer_tree_host_unittest_scroll.cc
@@ -241,11 +241,8 @@ class LayerTreeHostScrollTestCaseWithChild :
public LayerTreeHostScrollTest,
public WebKit::WebLayerScrollClient {
public:
- LayerTreeHostScrollTestCaseWithChild(
- float device_scale_factor, bool scroll_child_layer)
- : device_scale_factor_(device_scale_factor),
- scroll_child_layer_(scroll_child_layer),
- initial_offset_(10, 20),
+ LayerTreeHostScrollTestCaseWithChild()
+ : initial_offset_(10, 20),
javascript_scroll_(40, 5),
scroll_amount_(2, -1),
num_scrolls_(0) {
@@ -436,9 +433,10 @@ class LayerTreeHostScrollTestCaseWithChild :
}
}
- private:
+ protected:
float device_scale_factor_;
bool scroll_child_layer_;
+
gfx::Vector2d initial_offset_;
gfx::Vector2d javascript_scroll_;
gfx::Vector2d scroll_amount_;
@@ -453,24 +451,44 @@ class LayerTreeHostScrollTestCaseWithChild :
scoped_refptr<Layer> expected_no_scroll_layer_;
};
-MULTI_THREAD_TEST_P2(LayerTreeHostScrollTestCaseWithChild,
- DeviceScaleFactor1, 1.0f,
- ScrollChild, true)
-MULTI_THREAD_TEST_P2(LayerTreeHostScrollTestCaseWithChild,
- DeviceScaleFactor15, 1.5f,
- ScrollChild, true)
-MULTI_THREAD_TEST_P2(LayerTreeHostScrollTestCaseWithChild,
- DeviceScaleFactor2, 2.0f,
- ScrollChild, true)
-MULTI_THREAD_TEST_P2(LayerTreeHostScrollTestCaseWithChild,
- DeviceScaleFactor1, 1.0f,
- ScrollRootScrollLayer, false)
-MULTI_THREAD_TEST_P2(LayerTreeHostScrollTestCaseWithChild,
- DeviceScaleFactor15, 1.5f,
- ScrollRootScrollLayer, false)
-MULTI_THREAD_TEST_P2(LayerTreeHostScrollTestCaseWithChild,
- DeviceScaleFactor2, 2.0f,
- ScrollRootScrollLayer, false)
+TEST_F(LayerTreeHostScrollTestCaseWithChild, DeviceScaleFactor1_ScrollChild) {
+ device_scale_factor_ = 1.f;
+ scroll_child_layer_ = true;
+ runTest(true);
+}
+
+TEST_F(LayerTreeHostScrollTestCaseWithChild, DeviceScaleFactor15_ScrollChild) {
+ device_scale_factor_ = 1.5f;
+ scroll_child_layer_ = true;
+ runTest(true);
+}
+
+TEST_F(LayerTreeHostScrollTestCaseWithChild, DeviceScaleFactor2_ScrollChild) {
+ device_scale_factor_ = 2.f;
+ scroll_child_layer_ = true;
+ runTest(true);
+}
+
+TEST_F(LayerTreeHostScrollTestCaseWithChild,
+ DeviceScaleFactor1_ScrollRootScrollLayer) {
+ device_scale_factor_ = 1.f;
+ scroll_child_layer_ = false;
+ runTest(true);
+}
+
+TEST_F(LayerTreeHostScrollTestCaseWithChild,
+ DeviceScaleFactor15_ScrollRootScrollLayer) {
+ device_scale_factor_ = 1.5f;
+ scroll_child_layer_ = false;
+ runTest(true);
+}
+
+TEST_F(LayerTreeHostScrollTestCaseWithChild,
+ DeviceScaleFactor2_ScrollRootScrollLayer) {
+ device_scale_factor_ = 2.f;
+ scroll_child_layer_ = false;
+ runTest(true);
+}
} // namespace
} // namespace cc
« no previous file with comments | « cc/layer_tree_host_unittest_context.cc ('k') | cc/resource_provider_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698