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

Unified Diff: cc/layers/viewport_unittest.cc

Issue 1866583002: Connect LTHI::ScrollAnimated to cc::Viewport (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/layers/viewport.cc ('k') | cc/trees/layer_tree_host_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/viewport_unittest.cc
diff --git a/cc/layers/viewport_unittest.cc b/cc/layers/viewport_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..d2646a26886f1ced204396df1acb619505aca4d7
--- /dev/null
+++ b/cc/layers/viewport_unittest.cc
@@ -0,0 +1,30 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "cc/layers/viewport.h"
+
+#include <stddef.h>
+
+#include "cc/test/layer_test_common.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace cc {
+
+TEST(ViewportTest, ShouldAnimateViewport) {
+ EXPECT_TRUE(Viewport::ShouldAnimateViewport(gfx::Vector2dF(10, 1),
+ gfx::Vector2dF(8, 5)));
+ EXPECT_TRUE(Viewport::ShouldAnimateViewport(gfx::Vector2dF(0, 10),
+ gfx::Vector2dF(4, 8)));
+ EXPECT_TRUE(Viewport::ShouldAnimateViewport(gfx::Vector2dF(10, 10),
+ gfx::Vector2dF(8, 9)));
+
+ EXPECT_FALSE(Viewport::ShouldAnimateViewport(gfx::Vector2dF(8, 10),
+ gfx::Vector2dF(8, 10)));
+ EXPECT_FALSE(Viewport::ShouldAnimateViewport(gfx::Vector2dF(8, 10),
+ gfx::Vector2dF(10, 0)));
+ EXPECT_FALSE(Viewport::ShouldAnimateViewport(gfx::Vector2dF(10, 10),
+ gfx::Vector2dF(10, 18)));
+}
+
+} // namespace cc
« no previous file with comments | « cc/layers/viewport.cc ('k') | cc/trees/layer_tree_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698