Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Side by Side Diff: cc/output/buffer_to_texture_target_map_unittest.cc

Issue 2120713002: Fix use_image_texture_target inconsistencies (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix content browsertests Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/output/buffer_to_texture_target_map.cc ('k') | cc/output/renderer_settings.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 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.
4
5 #include "cc/output/buffer_to_texture_target_map.h"
6
7 #include "testing/gtest/include/gtest/gtest.h"
8 #include "ui/gfx/buffer_types.h"
9
10 namespace cc {
11 namespace {
12
13 // Ensures that a map populated with various values can be serialized to/from
14 // string successfully.
15 TEST(BufferToTextureTargetMapTest, SerializeRoundTrip) {
16 BufferToTextureTargetMap test_map;
17 uint32_t next_value = 0;
18 for (int usage_idx = 0; usage_idx <= static_cast<int>(gfx::BufferUsage::LAST);
19 ++usage_idx) {
20 gfx::BufferUsage usage = static_cast<gfx::BufferUsage>(usage_idx);
21 for (int format_idx = 0;
22 format_idx <= static_cast<int>(gfx::BufferFormat::LAST);
23 ++format_idx) {
24 gfx::BufferFormat format = static_cast<gfx::BufferFormat>(format_idx);
25 test_map.insert(BufferToTextureTargetMap::value_type(
26 BufferToTextureTargetKey(usage, format), next_value++));
27 }
28 }
29
30 std::string serialized_map = BufferToTextureTargetMapToString(test_map);
31 BufferToTextureTargetMap deserialized_map =
32 StringToBufferToTextureTargetMap(serialized_map);
33 EXPECT_EQ(test_map, deserialized_map);
34 }
35
36 } // namespace
37 } // namespace cc
OLDNEW
« no previous file with comments | « cc/output/buffer_to_texture_target_map.cc ('k') | cc/output/renderer_settings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698