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

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

Issue 6364013: Defered collect DirectX diagnostics until they are needed for about:gpu.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 11 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_internal.h ('k') | chrome/common/gpu_param_traits.h » ('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 HP Z600 Workstation 15 // Test variables taken from HP Z600 Workstation
16 input.SetProgress(GPUInfo::kPartial); 16 input.SetLevel(GPUInfo::kPartial);
17 input.SetInitializationTime(base::TimeDelta::FromMilliseconds(100)); 17 input.SetInitializationTime(base::TimeDelta::FromMilliseconds(100));
18 input.SetVideoCardInfo(0x10de, 0x0658); 18 input.SetVideoCardInfo(0x10de, 0x0658);
19 input.SetDriverInfo("NVIDIA", "195.36.24"); 19 input.SetDriverInfo("NVIDIA", "195.36.24");
20 input.SetShaderVersion(0x0162, 0x0162); 20 input.SetShaderVersion(0x0162, 0x0162);
21 input.SetGLVersion(0x0302); 21 input.SetGLVersion(0x0302);
22 input.SetGLVersionString("3.2.0 NVIDIA 195.36.24"); 22 input.SetGLVersionString("3.2.0 NVIDIA 195.36.24");
23 input.SetGLVendor("NVIDIA Corporation"); 23 input.SetGLVendor("NVIDIA Corporation");
24 input.SetGLRenderer("Quadro FX 380/PCI/SSE2"); 24 input.SetGLRenderer("Quadro FX 380/PCI/SSE2");
25 input.SetGLExtensions("GL_ARB_texture_rg GL_ARB_window_pos"); 25 input.SetGLExtensions("GL_ARB_texture_rg GL_ARB_window_pos");
26 input.SetCanLoseContext(false); 26 input.SetCanLoseContext(false);
27 27
28 IPC::Message msg(1, 2, IPC::Message::PRIORITY_NORMAL); 28 IPC::Message msg(1, 2, IPC::Message::PRIORITY_NORMAL);
29 IPC::WriteParam(&msg, input); 29 IPC::WriteParam(&msg, input);
30 30
31 GPUInfo output; 31 GPUInfo output;
32 void* iter = NULL; 32 void* iter = NULL;
33 EXPECT_TRUE(IPC::ReadParam(&msg, &iter, &output)); 33 EXPECT_TRUE(IPC::ReadParam(&msg, &iter, &output));
34 EXPECT_EQ(input.progress(), output.progress()); 34 EXPECT_EQ(input.level(), output.level());
35 EXPECT_EQ(input.initialization_time().InMilliseconds(), 35 EXPECT_EQ(input.initialization_time().InMilliseconds(),
36 output.initialization_time().InMilliseconds()); 36 output.initialization_time().InMilliseconds());
37 EXPECT_EQ(input.vendor_id(), output.vendor_id()); 37 EXPECT_EQ(input.vendor_id(), output.vendor_id());
38 EXPECT_EQ(input.device_id(), output.device_id()); 38 EXPECT_EQ(input.device_id(), output.device_id());
39 EXPECT_EQ(input.driver_vendor(), output.driver_vendor()); 39 EXPECT_EQ(input.driver_vendor(), output.driver_vendor());
40 EXPECT_EQ(input.driver_version(), output.driver_version()); 40 EXPECT_EQ(input.driver_version(), output.driver_version());
41 EXPECT_EQ(input.pixel_shader_version(), output.pixel_shader_version()); 41 EXPECT_EQ(input.pixel_shader_version(), output.pixel_shader_version());
42 EXPECT_EQ(input.vertex_shader_version(), output.vertex_shader_version()); 42 EXPECT_EQ(input.vertex_shader_version(), output.vertex_shader_version());
43 EXPECT_EQ(input.gl_version(), output.gl_version()); 43 EXPECT_EQ(input.gl_version(), output.gl_version());
44 EXPECT_EQ(input.gl_version_string(), output.gl_version_string()); 44 EXPECT_EQ(input.gl_version_string(), output.gl_version_string());
45 EXPECT_EQ(input.gl_vendor(), output.gl_vendor()); 45 EXPECT_EQ(input.gl_vendor(), output.gl_vendor());
46 EXPECT_EQ(input.gl_renderer(), output.gl_renderer()); 46 EXPECT_EQ(input.gl_renderer(), output.gl_renderer());
47 EXPECT_EQ(input.gl_extensions(), output.gl_extensions()); 47 EXPECT_EQ(input.gl_extensions(), output.gl_extensions());
48 EXPECT_EQ(input.can_lose_context(), output.can_lose_context()); 48 EXPECT_EQ(input.can_lose_context(), output.can_lose_context());
49 49
50 std::string log_message; 50 std::string log_message;
51 IPC::LogParam(output, &log_message); 51 IPC::LogParam(output, &log_message);
52 EXPECT_STREQ("<GPUInfo> 1 100 10de 658 NVIDIA 195.36.24 162 162 302 0", 52 EXPECT_STREQ("<GPUInfo> 1 100 10de 658 NVIDIA 195.36.24 162 162 302 0",
53 log_message.c_str()); 53 log_message.c_str());
54 } 54 }
OLDNEW
« no previous file with comments | « chrome/common/gpu_messages_internal.h ('k') | chrome/common/gpu_param_traits.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698