diff options
Diffstat (limited to 'ui/gfx/geometry/test/rect_test_util.cc')
-rw-r--r-- | ui/gfx/geometry/test/rect_test_util.cc | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/ui/gfx/geometry/test/rect_test_util.cc b/ui/gfx/geometry/test/rect_test_util.cc new file mode 100644 index 0000000000..bcc943b7fc --- /dev/null +++ b/ui/gfx/geometry/test/rect_test_util.cc @@ -0,0 +1,23 @@ +// Copyright 2017 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 "ui/gfx/geometry/test/rect_test_util.h" + +namespace gfx { +namespace test { + +testing::AssertionResult RectContains(const gfx::Rect& outer_rect, + const gfx::Rect& inner_rect) { + if (outer_rect.Contains(inner_rect)) { + return testing::AssertionSuccess() + << "outer_rect (" << outer_rect.ToString() + << ") does contain inner_rect (" << inner_rect.ToString() << ")"; + } + return testing::AssertionFailure() << "outer_rect (" << outer_rect.ToString() + << ") does not contain inner_rect (" + << inner_rect.ToString() << ")"; +} + +} // namespace test +} // namespace gfx |