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

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

Issue 4860001: Collect DirectX diagnostic information asynchronously.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 1 month 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.cc ('k') | chrome/gpu/gpu_info_collector_linux.cc » ('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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/scoped_ptr.h" 5 #include "base/scoped_ptr.h"
6 #include "chrome/common/gpu_info.h" 6 #include "chrome/common/gpu_info.h"
7 #include "chrome/common/gpu_messages.h" 7 #include "chrome/common/gpu_messages.h"
8 #include "ipc/ipc_message.h" 8 #include "ipc/ipc_message.h"
9 #include "ipc/ipc_message_utils.h" 9 #include "ipc/ipc_message_utils.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
11 11
12 // Test GPUInfo serialization 12 // Test GPUInfo serialization
13 TEST(GPUIPCMessageTest, GPUInfo) { 13 TEST(GPUIPCMessageTest, GPUInfo) {
14 GPUInfo input; 14 GPUInfo input;
15 // Test variables taken from Lenovo T61 15 // Test variables taken from Lenovo T61
16 input.SetProgress(GPUInfo::kPartial);
16 input.SetInitializationTime(base::TimeDelta::FromMilliseconds(100)); 17 input.SetInitializationTime(base::TimeDelta::FromMilliseconds(100));
17 input.SetGraphicsInfo(0x10de, 0x429, L"6.14.11.7715", 18 input.SetGraphicsInfo(0x10de, 0x429, L"6.14.11.7715",
18 0xffff0300, 19 0xffff0300,
19 0xfffe0300, 20 0xfffe0300,
20 0x00010005, 21 0x00010005,
21 true); 22 true);
22 23
23 IPC::Message msg(1, 2, IPC::Message::PRIORITY_NORMAL); 24 IPC::Message msg(1, 2, IPC::Message::PRIORITY_NORMAL);
24 IPC::WriteParam(&msg, input); 25 IPC::WriteParam(&msg, input);
25 26
26 GPUInfo output; 27 GPUInfo output;
27 void* iter = NULL; 28 void* iter = NULL;
28 EXPECT_TRUE(IPC::ReadParam(&msg, &iter, &output)); 29 EXPECT_TRUE(IPC::ReadParam(&msg, &iter, &output));
30 EXPECT_EQ(input.progress(), output.progress());
29 EXPECT_EQ(input.initialization_time().InMilliseconds(), 31 EXPECT_EQ(input.initialization_time().InMilliseconds(),
30 output.initialization_time().InMilliseconds()); 32 output.initialization_time().InMilliseconds());
31 EXPECT_EQ(input.vendor_id(), output.vendor_id()); 33 EXPECT_EQ(input.vendor_id(), output.vendor_id());
32 EXPECT_EQ(input.device_id(), output.device_id()); 34 EXPECT_EQ(input.device_id(), output.device_id());
33 EXPECT_EQ(input.driver_version(), output.driver_version()); 35 EXPECT_EQ(input.driver_version(), output.driver_version());
34 EXPECT_EQ(input.pixel_shader_version(), output.pixel_shader_version()); 36 EXPECT_EQ(input.pixel_shader_version(), output.pixel_shader_version());
35 EXPECT_EQ(input.vertex_shader_version(), output.vertex_shader_version()); 37 EXPECT_EQ(input.vertex_shader_version(), output.vertex_shader_version());
36 EXPECT_EQ(input.gl_version(), output.gl_version()); 38 EXPECT_EQ(input.gl_version(), output.gl_version());
37 EXPECT_EQ(input.can_lose_context(), output.can_lose_context()); 39 EXPECT_EQ(input.can_lose_context(), output.can_lose_context());
38 40
39 std::string log_message; 41 std::string log_message;
40 IPC::LogParam(output, &log_message); 42 IPC::LogParam(output, &log_message);
41 EXPECT_STREQ("<GPUInfo> 100 10de 429 6.14.11.7715 1", log_message.c_str()); 43 EXPECT_STREQ("<GPUInfo> 1 100 10de 429 6.14.11.7715 1", log_message.c_str());
42 } 44 }
OLDNEW
« no previous file with comments | « chrome/common/gpu_messages.cc ('k') | chrome/gpu/gpu_info_collector_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698