Chromium Code Reviews| Index: ui/gfx/geometry/test/rect_test_util.cc |
| 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 0000000000000000000000000000000000000000..bcc943b7fc506520c0b9de92269d98810622fff2 |
| --- /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() |
|
sky
2017/02/17 16:44:13
Is it really typical to log information about the
bruthig
2017/02/17 16:49:17
The success logging will be used if it fails an (E
|
| + << "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 |