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

Side by Side Diff: chrome/common/gpu_messages_unittest.cc

Issue 3104011: Add Mac GPU logging code. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « chrome/common/gpu_messages.h ('k') | chrome/gpu/gpu_info_collector_mac.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/logging.h" 5 #include "base/logging.h"
6 #include "base/scoped_ptr.h" 6 #include "base/scoped_ptr.h"
7 #include "chrome/common/gpu_info.h" 7 #include "chrome/common/gpu_info.h"
8 #include "chrome/common/gpu_messages.h" 8 #include "chrome/common/gpu_messages.h"
9 #include "ipc/ipc_message.h" 9 #include "ipc/ipc_message.h"
10 #include "ipc/ipc_message_utils.h" 10 #include "ipc/ipc_message_utils.h"
11 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
12 12
13 // Test GPUInfo serialization 13 // Test GPUInfo serialization
14 TEST(GPUIPCMessageTest, GPUInfo) { 14 TEST(GPUIPCMessageTest, GPUInfo) {
15 GPUInfo input; 15 GPUInfo input;
16 // Test variables taken from Lenovo T61 16 // Test variables taken from Lenovo T61
17 input.SetGraphicsInfo(0x10de, 0x429, L"6.14.11.7715", 17 input.SetGraphicsInfo(0x10de, 0x429, L"6.14.11.7715",
18 0xffff0300, 0xfffe0300); 18 0xffff0300, 0xfffe0300,
19 0x00010005);
19 20
20 IPC::Message msg(1, 2, IPC::Message::PRIORITY_NORMAL); 21 IPC::Message msg(1, 2, IPC::Message::PRIORITY_NORMAL);
21 IPC::WriteParam(&msg, input); 22 IPC::WriteParam(&msg, input);
22 23
23 GPUInfo output; 24 GPUInfo output;
24 void* iter = NULL; 25 void* iter = NULL;
25 EXPECT_TRUE(IPC::ReadParam(&msg, &iter, &output)); 26 EXPECT_TRUE(IPC::ReadParam(&msg, &iter, &output));
26 EXPECT_EQ(input.vendor_id(), output.vendor_id()); 27 EXPECT_EQ(input.vendor_id(), output.vendor_id());
27 EXPECT_EQ(input.device_id(), output.device_id()); 28 EXPECT_EQ(input.device_id(), output.device_id());
28 EXPECT_EQ(input.driver_version(), output.driver_version()); 29 EXPECT_EQ(input.driver_version(), output.driver_version());
29 EXPECT_EQ(input.pixel_shader_version(), output.pixel_shader_version()); 30 EXPECT_EQ(input.pixel_shader_version(), output.pixel_shader_version());
30 EXPECT_EQ(input.vertex_shader_version(), output.vertex_shader_version()); 31 EXPECT_EQ(input.vertex_shader_version(), output.vertex_shader_version());
32 EXPECT_EQ(input.gl_version(), output.gl_version());
31 33
32 std::string log_message; 34 std::string log_message;
33 IPC::LogParam(output, &log_message); 35 IPC::LogParam(output, &log_message);
34 EXPECT_STREQ("<GPUInfo> 10de 429 6.14.11.7715", log_message.c_str()); 36 EXPECT_STREQ("<GPUInfo> 10de 429 6.14.11.7715", log_message.c_str());
35 } 37 }
OLDNEW
« no previous file with comments | « chrome/common/gpu_messages.h ('k') | chrome/gpu/gpu_info_collector_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698