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

Side by Side Diff: remoting/jingle_glue/iq_request_unittest.cc

Issue 7016011: iwyu: Include stringprintf.h where appropriate, part 3. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Win fix. Created 9 years, 7 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 | « printing/page_overlays_unittest.cc ('k') | ui/base/clipboard/clipboard_util_win.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/ref_counted.h" 5 #include "base/memory/ref_counted.h"
6 #include "base/string_util.h" 6 #include "base/stringprintf.h"
7 #include "remoting/jingle_glue/iq_request.h" 7 #include "remoting/jingle_glue/iq_request.h"
8 #include "testing/gmock/include/gmock/gmock.h" 8 #include "testing/gmock/include/gmock/gmock.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 #include "third_party/libjingle/source/talk/xmllite/xmlelement.h" 10 #include "third_party/libjingle/source/talk/xmllite/xmlelement.h"
11 11
12 namespace remoting { 12 namespace remoting {
13 13
14 TEST(IqRequestTest, MakeIqStanza) { 14 TEST(IqRequestTest, MakeIqStanza) {
15 const char* kMessageId = "0"; 15 const char* kMessageId = "0";
16 const char* kNamespace = "chromium:testns"; 16 const char* kNamespace = "chromium:testns";
17 const char* kNamespacePrefix = "tes"; 17 const char* kNamespacePrefix = "tes";
18 const char* kBodyTag = "test"; 18 const char* kBodyTag = "test";
19 const char* kType = "get"; 19 const char* kType = "get";
20 const char* kTo = "user@domain.com"; 20 const char* kTo = "user@domain.com";
21 21
22 std::string expected_xml_string = 22 std::string expected_xml_string =
23 StringPrintf( 23 base::StringPrintf(
24 "<cli:iq type=\"%s\" to=\"%s\" id=\"%s\" " 24 "<cli:iq type=\"%s\" to=\"%s\" id=\"%s\" "
25 "xmlns:cli=\"jabber:client\">" 25 "xmlns:cli=\"jabber:client\">"
26 "<%s:%s xmlns:%s=\"%s\"/>" 26 "<%s:%s xmlns:%s=\"%s\"/>"
27 "</cli:iq>", 27 "</cli:iq>",
28 kType, kTo, kMessageId, kNamespacePrefix, kBodyTag, 28 kType, kTo, kMessageId, kNamespacePrefix, kBodyTag,
29 kNamespacePrefix, kNamespace); 29 kNamespacePrefix, kNamespace);
30 30
31 buzz::XmlElement* iq_body = 31 buzz::XmlElement* iq_body =
32 new buzz::XmlElement(buzz::QName(kNamespace, kBodyTag)); 32 new buzz::XmlElement(buzz::QName(kNamespace, kBodyTag));
33 scoped_ptr<buzz::XmlElement> stanza( 33 scoped_ptr<buzz::XmlElement> stanza(
34 IqRequest::MakeIqStanza(kType, kTo, iq_body, kMessageId)); 34 IqRequest::MakeIqStanza(kType, kTo, iq_body, kMessageId));
35 35
36 EXPECT_EQ(expected_xml_string, stanza->Str()); 36 EXPECT_EQ(expected_xml_string, stanza->Str());
37 } 37 }
38 38
39 } // namespace remoting 39 } // namespace remoting
OLDNEW
« no previous file with comments | « printing/page_overlays_unittest.cc ('k') | ui/base/clipboard/clipboard_util_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698