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

Unified Diff: Source/core/compositing/DisplayListCompositingBuilderTest.cpp

Issue 1287093004: Slimming Paint phase 2 compositing algorithm plumbing (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Address reviewer comments Created 5 years, 4 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
Index: Source/core/compositing/DisplayListCompositingBuilderTest.cpp
diff --git a/Source/core/compositing/DisplayListCompositingBuilderTest.cpp b/Source/core/compositing/DisplayListCompositingBuilderTest.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..a7d174d994fa73319e5f46dfd3f933135b5a951c
--- /dev/null
+++ b/Source/core/compositing/DisplayListCompositingBuilderTest.cpp
@@ -0,0 +1,48 @@
+// Copyright 2015 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 "config.h"
+#include "core/compositing/DisplayListCompositingBuilder.h"
+
+#include "platform/RuntimeEnabledFeatures.h"
+#include <gtest/gtest.h>
+
+namespace blink {
+
+class DisplayListCompositingBuilderTest : public ::testing::Test {
+public:
+ DisplayListCompositingBuilderTest()
+ : m_originalSlimmingPaintV2Enabled(RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { }
+
+private:
+ void SetUp() override
+ {
+ ASSERT_TRUE(RuntimeEnabledFeatures::slimmingPaintEnabled());
+ RuntimeEnabledFeatures::setSlimmingPaintV2Enabled(true);
+ }
+
+ void TearDown() override
+ {
+ RuntimeEnabledFeatures::setSlimmingPaintV2Enabled(m_originalSlimmingPaintV2Enabled);
+ }
+
+ bool m_originalSlimmingPaintV2Enabled;
+};
+
+TEST_F(DisplayListCompositingBuilderTest, BasicTransformPropertyTree)
+{
+ OwnPtr<DisplayItemList> displayItemList = DisplayItemList::create();
+ DisplayListDiff displayListDiff;
+ displayItemList->commitNewDisplayItems(&displayListDiff);
+
+ DisplayListCompositingBuilder compositingBuilder(*displayItemList, displayListDiff);
+ auto compositedDisplayList = compositingBuilder.build();
+
+ const auto* tree = compositedDisplayList.transformTree.get();
+ ASSERT_EQ(1u, tree->nodeCount());
+ EXPECT_TRUE(tree->nodeAt(0).isRoot());
+ EXPECT_TRUE(tree->nodeAt(0).matrix.isIdentity());
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698