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

Unified Diff: Source/platform/testing/GeometryPrinters.h

Issue 1285413007: Unify geometry test printers in a test support target. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: PrintTo instead of operator<< 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
« no previous file with comments | « Source/platform/platform.gni ('k') | Source/platform/testing/GeometryPrinters.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/testing/GeometryPrinters.h
diff --git a/Source/platform/testing/GeometryPrinters.h b/Source/platform/testing/GeometryPrinters.h
new file mode 100644
index 0000000000000000000000000000000000000000..de88fbc6fc6d3b91795e39c3415204301f22c15c
--- /dev/null
+++ b/Source/platform/testing/GeometryPrinters.h
@@ -0,0 +1,42 @@
+// 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.
+
+#ifndef GeometryPrinters_h
+#define GeometryPrinters_h
+
+#include "platform/geometry/FloatRoundedRect.h"
+#include <iosfwd>
+
+namespace blink {
+
+class FloatBox;
+class FloatPoint;
+class FloatQuad;
+class FloatRect;
+class FloatSize;
+class LayoutRect;
+
+// GTest print support for geometry classes.
+//
+// To avoid ODR violations, these should also be declared in the respective
+// headers defining these types. This is required because otherwise a template
+// instantiation may be instantiated differently, depending on whether this
+// declaration is found.
+//
+// As a result, it is not necessary to include this file in tests in order to
+// use these printers. If, however, you get a link error about these symbols,
+// you need to make sure the blink_platform_test_support target is linked in
+// your unit test binary.
+void PrintTo(const FloatBox&, std::ostream*);
+void PrintTo(const FloatPoint&, std::ostream*);
+void PrintTo(const FloatQuad&, std::ostream*);
+void PrintTo(const FloatRect&, std::ostream*);
+void PrintTo(const FloatRoundedRect&, std::ostream*);
+void PrintTo(const FloatRoundedRect::Radii&, std::ostream*);
+void PrintTo(const FloatSize&, std::ostream*);
+void PrintTo(const LayoutRect&, std::ostream*);
+
+} // namespace blink
+
+#endif // GeometryPrinters_h
« no previous file with comments | « Source/platform/platform.gni ('k') | Source/platform/testing/GeometryPrinters.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698