Don't add an aura tooltip to bubble close buttons on Windows.
[chromium-blink-merge.git] / gpu / command_buffer / service / shader_translator_cache_unittest.cc
blobc5233e510e8351a54ae36d65f97a07345cea8429
1 // Copyright (c) 2014 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 <GLES2/gl2.h>
7 #include "gpu/command_buffer/service/shader_translator_cache.h"
8 #include "testing/gtest/include/gtest/gtest.h"
10 namespace gpu {
11 namespace gles2 {
13 TEST(ShaderTranslatorCacheTest, InitParamComparable) {
14 // Tests that ShaderTranslatorInitParams padding or padding of its
15 // members does not affect the object equality or ordering.
17 ShBuiltInResources a_resources;
18 memset(&a_resources, 88, sizeof(a_resources));
19 ShInitBuiltInResources(&a_resources);
21 ShBuiltInResources b_resources;
22 memset(&b_resources, 77, sizeof(b_resources));
23 ShInitBuiltInResources(&b_resources);
25 EXPECT_TRUE(memcmp(&a_resources, &b_resources, sizeof(a_resources)) == 0);
27 ShCompileOptions driver_bug_workarounds = SH_VALIDATE;
29 char a_storage[sizeof(ShaderTranslatorCache::ShaderTranslatorInitParams)];
30 memset(a_storage, 55, sizeof(a_storage));
31 ShaderTranslatorCache::ShaderTranslatorInitParams* a =
32 new (&a_storage) ShaderTranslatorCache::ShaderTranslatorInitParams(
33 GL_VERTEX_SHADER,
34 SH_GLES2_SPEC,
35 a_resources,
36 ShaderTranslatorInterface::kGlslES,
37 driver_bug_workarounds);
39 ShaderTranslatorCache::ShaderTranslatorInitParams b(
40 GL_VERTEX_SHADER,
41 SH_GLES2_SPEC,
42 b_resources,
43 ShaderTranslatorInterface::kGlslES,
44 driver_bug_workarounds);
46 EXPECT_TRUE(*a == b);
47 EXPECT_FALSE(*a < b || b < *a);
49 memset(a_storage, 55, sizeof(a_storage));
50 a = new (&a_storage) ShaderTranslatorCache::ShaderTranslatorInitParams(b);
52 EXPECT_TRUE(*a == b);
53 EXPECT_FALSE(*a < b || b < *a);
55 } // namespace gles2
56 } // namespace gpu