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

Unified Diff: Source/core/layout/style/SVGLayoutStyleTest.cpp

Issue 1033943002: Rename LayoutStyle to papayawhip (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: ensureComputedStyle Created 5 years, 9 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 | « Source/core/layout/style/SVGLayoutStyleDefs.cpp ('k') | Source/core/layout/style/ShapeValue.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/style/SVGLayoutStyleTest.cpp
diff --git a/Source/core/layout/style/SVGLayoutStyleTest.cpp b/Source/core/layout/style/SVGLayoutStyleTest.cpp
deleted file mode 100644
index 7f0c90f5ca47c40ee497a1356917d89afd9d6397..0000000000000000000000000000000000000000
--- a/Source/core/layout/style/SVGLayoutStyleTest.cpp
+++ /dev/null
@@ -1,70 +0,0 @@
-// Copyright 2014 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/layout/style/SVGLayoutStyle.h"
-
-#include <gtest/gtest.h>
-
-using namespace blink;
-
-namespace {
-
-// Ensures RefPtr values are compared by their values, not by pointers.
-#define TEST_STYLE_REFPTR_VALUE_NO_DIFF(type, fieldName) \
- { \
- RefPtr<SVGLayoutStyle> svg1 = SVGLayoutStyle::create(); \
- RefPtr<SVGLayoutStyle> svg2 = SVGLayoutStyle::create(); \
- RefPtr<type> value1 = type::create(); \
- RefPtr<type> value2 = value1->copy(); \
- svg1->set##fieldName(value1); \
- svg2->set##fieldName(value2); \
- EXPECT_FALSE(svg1->diff(svg2.get()).hasDifference()); \
- }
-
-// This is not very useful for fields directly stored by values, because they can only be
-// compared by values. This macro mainly ensures that we update the comparisons and tests
-// when we change some field to RefPtr in the future.
-#define TEST_STYLE_VALUE_NO_DIFF(type, fieldName) \
- { \
- RefPtr<SVGLayoutStyle> svg1 = SVGLayoutStyle::create(); \
- RefPtr<SVGLayoutStyle> svg2 = SVGLayoutStyle::create(); \
- svg1->set##fieldName(SVGLayoutStyle::initial##fieldName()); \
- svg2->set##fieldName(SVGLayoutStyle::initial##fieldName()); \
- EXPECT_FALSE(svg1->diff(svg2.get()).hasDifference()); \
- }
-
-TEST(SVGLayoutStyleTest, StrokeStyleShouldCompareValue)
-{
- TEST_STYLE_VALUE_NO_DIFF(float, StrokeOpacity);
- TEST_STYLE_VALUE_NO_DIFF(float, StrokeMiterLimit);
- TEST_STYLE_VALUE_NO_DIFF(UnzoomedLength, StrokeWidth);
- TEST_STYLE_VALUE_NO_DIFF(Length, StrokeDashOffset);
- TEST_STYLE_REFPTR_VALUE_NO_DIFF(SVGDashArray, StrokeDashArray);
-
- {
- RefPtr<SVGLayoutStyle> svg1 = SVGLayoutStyle::create();
- RefPtr<SVGLayoutStyle> svg2 = SVGLayoutStyle::create();
- svg1->setStrokePaint(SVGLayoutStyle::initialStrokePaintType(), SVGLayoutStyle::initialStrokePaintColor(), SVGLayoutStyle::initialStrokePaintUri(), true, false);
- svg2->setStrokePaint(SVGLayoutStyle::initialStrokePaintType(), SVGLayoutStyle::initialStrokePaintColor(), SVGLayoutStyle::initialStrokePaintUri(), true, false);
- EXPECT_FALSE(svg1->diff(svg2.get()).hasDifference());
- }
- {
- RefPtr<SVGLayoutStyle> svg1 = SVGLayoutStyle::create();
- RefPtr<SVGLayoutStyle> svg2 = SVGLayoutStyle::create();
- svg1->setStrokePaint(SVGLayoutStyle::initialStrokePaintType(), SVGLayoutStyle::initialStrokePaintColor(), SVGLayoutStyle::initialStrokePaintUri(), false, true);
- svg2->setStrokePaint(SVGLayoutStyle::initialStrokePaintType(), SVGLayoutStyle::initialStrokePaintColor(), SVGLayoutStyle::initialStrokePaintUri(), false, true);
- EXPECT_FALSE(svg1->diff(svg2.get()).hasDifference());
- }
-}
-
-TEST(SVGLayoutStyleTest, MiscStyleShouldCompareValue)
-{
- TEST_STYLE_VALUE_NO_DIFF(Color, FloodColor);
- TEST_STYLE_VALUE_NO_DIFF(float, FloodOpacity);
- TEST_STYLE_VALUE_NO_DIFF(Color, LightingColor);
- TEST_STYLE_VALUE_NO_DIFF(Length, BaselineShiftValue);
-}
-
-}
« no previous file with comments | « Source/core/layout/style/SVGLayoutStyleDefs.cpp ('k') | Source/core/layout/style/ShapeValue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698