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

Side by Side Diff: printing/backend/print_backend_unittest.cc

Issue 10963050: Set max title size to 50 (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 | « printing/backend/print_backend.cc ('k') | no next file » | 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 "printing/backend/print_backend.h" 5 #include "printing/backend/print_backend.h"
6 #include "base/utf_string_conversions.h" 6 #include "base/utf_string_conversions.h"
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 8
9 namespace printing { 9 namespace printing {
10 10
11 std::string Simplify(const char* title) { 11 std::string Simplify(const char* title) {
12 return UTF16ToUTF8(PrintBackend::SimplifyDocumentTitle(ASCIIToUTF16(title))); 12 return UTF16ToUTF8(PrintBackend::SimplifyDocumentTitle(ASCIIToUTF16(title)));
13 } 13 }
14 14
15 TEST(PrintBackendTest, SimplifyDocumentTitle) { 15 TEST(PrintBackendTest, SimplifyDocumentTitle) {
16 EXPECT_STREQ("", Simplify("").c_str()); 16 EXPECT_STREQ("", Simplify("").c_str());
17 EXPECT_STREQ("Document wi...oooong name", 17 EXPECT_STREQ("Long string. Long string...ng string. Long string.",
18 Simplify("Document with very looooooooooong name").c_str()); 18 Simplify("Long string. Long string. Long string. Long string. "
19 "Long string. Long string. Long string.").c_str());
19 EXPECT_STREQ("Control Characters", 20 EXPECT_STREQ("Control Characters",
20 Simplify("C\ron\ntrol Charac\15ters").c_str()); 21 Simplify("C\ron\ntrol Charac\15ters").c_str());
21 EXPECT_STREQ("", Simplify("\n\r\n\r\t\r").c_str()); 22 EXPECT_STREQ("", Simplify("\n\r\n\r\t\r").c_str());
22 } 23 }
23 24
24 } // namespace printing 25 } // namespace printing
25 26
OLDNEW
« no previous file with comments | « printing/backend/print_backend.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698