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

Side by Side Diff: remoting/host/server_log_entry_unittest.cc

Issue 10950018: Include the host version in every log entry that the host sends to the cloud. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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 | « remoting/host/server_log_entry.cc ('k') | remoting/remoting.gyp » ('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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/memory/scoped_ptr.h" 5 #include "base/memory/scoped_ptr.h"
6 #include "base/stringize_macros.h"
6 #include "remoting/host/server_log_entry.h" 7 #include "remoting/host/server_log_entry.h"
7 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
8 #include "third_party/libjingle/source/talk/xmllite/xmlelement.h" 9 #include "third_party/libjingle/source/talk/xmllite/xmlelement.h"
9 10
10 using buzz::XmlAttr; 11 using buzz::XmlAttr;
11 using buzz::XmlElement; 12 using buzz::XmlElement;
12 13
13 namespace remoting { 14 namespace remoting {
14 15
15 class ServerLogEntryTest : public testing::Test { 16 class ServerLogEntryTest : public testing::Test {
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 keys.insert("os-version"); 104 keys.insert("os-version");
104 #elif defined(OS_MACOSX) 105 #elif defined(OS_MACOSX)
105 key_value_pairs["os-name"] = "Mac"; 106 key_value_pairs["os-name"] = "Mac";
106 keys.insert("os-version"); 107 keys.insert("os-version");
107 #elif defined(OS_CHROMEOS) 108 #elif defined(OS_CHROMEOS)
108 key_value_pairs["os-name"] = "ChromeOS"; 109 key_value_pairs["os-name"] = "ChromeOS";
109 keys.insert("os-version"); 110 keys.insert("os-version");
110 #elif defined(OS_LINUX) 111 #elif defined(OS_LINUX)
111 key_value_pairs["os-name"] = "Linux"; 112 key_value_pairs["os-name"] = "Linux";
112 #endif 113 #endif
114 key_value_pairs["host-version"] = STRINGIZE(VERSION);
113 ASSERT_TRUE(VerifyStanza(key_value_pairs, keys, stanza.get(), &error)) << 115 ASSERT_TRUE(VerifyStanza(key_value_pairs, keys, stanza.get(), &error)) <<
114 error; 116 error;
115 } 117 }
116 118
117 TEST_F(ServerLogEntryTest, AddModeField1) { 119 TEST_F(ServerLogEntryTest, AddModeField1) {
118 scoped_ptr<ServerLogEntry> entry( 120 scoped_ptr<ServerLogEntry> entry(
119 ServerLogEntry::MakeForSessionStateChange(true)); 121 ServerLogEntry::MakeForSessionStateChange(true));
120 entry->AddModeField(ServerLogEntry::IT2ME); 122 entry->AddModeField(ServerLogEntry::IT2ME);
121 scoped_ptr<XmlElement> stanza = entry->ToStanza(); 123 scoped_ptr<XmlElement> stanza = entry->ToStanza();
122 std::string error; 124 std::string error;
(...skipping 17 matching lines...) Expand all
140 key_value_pairs["role"] = "host"; 142 key_value_pairs["role"] = "host";
141 key_value_pairs["event-name"] = "session-state"; 143 key_value_pairs["event-name"] = "session-state";
142 key_value_pairs["session-state"] = "connected"; 144 key_value_pairs["session-state"] = "connected";
143 key_value_pairs["mode"] = "me2me"; 145 key_value_pairs["mode"] = "me2me";
144 std::set<std::string> keys; 146 std::set<std::string> keys;
145 ASSERT_TRUE(VerifyStanza(key_value_pairs, keys, stanza.get(), &error)) << 147 ASSERT_TRUE(VerifyStanza(key_value_pairs, keys, stanza.get(), &error)) <<
146 error; 148 error;
147 } 149 }
148 150
149 } // namespace remoting 151 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/server_log_entry.cc ('k') | remoting/remoting.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698