1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "ui/gfx/test/color_util.h"
15 std::string ColorAsString(SkColor color) {
16 std::ostringstream stream;
17 stream << std::hex << std::uppercase << "#" << std::setfill('0')
18 << std::setw(2) << SkColorGetA(color)
19 << std::setw(2) << SkColorGetR(color)
20 << std::setw(2) << SkColorGetG(color)
21 << std::setw(2) << SkColorGetB(color);
27 ::testing::AssertionResult AssertSkColorsEqual(const char* lhs_expr,
32 return ::testing::AssertionSuccess();
34 return ::testing::AssertionFailure() << "Value of: " << rhs_expr
35 << "\n Actual: " << ColorAsString(rhs)
36 << "\nExpected: " << lhs_expr
37 << "\nWhich is: " << ColorAsString(lhs);