1 // Copyright 2015 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 "cc/resources/platform_color.h"
7 #include "testing/gtest/include/gtest/gtest.h"
12 // Verify SameComponentOrder on this platform.
13 TEST(PlatformColorTest
, SameComponentOrder
) {
14 bool rgba
= !!SK_B32_SHIFT
;
16 for (size_t i
= 0; i
<= RESOURCE_FORMAT_MAX
; ++i
) {
17 ResourceFormat format
= static_cast<ResourceFormat
>(i
);
20 EXPECT_EQ(rgba
, PlatformColor::SameComponentOrder(format
));
23 // RGBA_4444 indicates the number of bytes per pixel but the format
24 // doesn't actually imply RGBA ordering. It uses the native ordering.
25 EXPECT_EQ(true, PlatformColor::SameComponentOrder(format
));
28 EXPECT_NE(rgba
, PlatformColor::SameComponentOrder(format
));
35 EXPECT_FALSE(PlatformColor::SameComponentOrder(format
));