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

Side by Side Diff: printing/printing_utils_unittest.cc

Issue 1656933004: Printing: Remove backslashes from print job names. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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
« no previous file with comments | « printing/printing_utils.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "printing/printing_utils.h" 8 #include "printing/printing_utils.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
(...skipping 13 matching lines...) Expand all
24 base::UTF8ToUTF16(owner), base::UTF8ToUTF16(title), kTestLength)); 24 base::UTF8ToUTF16(owner), base::UTF8ToUTF16(title), kTestLength));
25 } 25 }
26 26
27 } // namespace 27 } // namespace
28 28
29 TEST(PrintingUtilsTest, SimplifyDocumentTitle) { 29 TEST(PrintingUtilsTest, SimplifyDocumentTitle) {
30 EXPECT_EQ("", Simplify("")); 30 EXPECT_EQ("", Simplify(""));
31 EXPECT_EQ("abcdefgh", Simplify("abcdefgh")); 31 EXPECT_EQ("abcdefgh", Simplify("abcdefgh"));
32 EXPECT_EQ("abc...ij", Simplify("abcdefghij")); 32 EXPECT_EQ("abc...ij", Simplify("abcdefghij"));
33 EXPECT_EQ("Controls", Simplify("C\ron\nt\15rols")); 33 EXPECT_EQ("Controls", Simplify("C\ron\nt\15rols"));
34 EXPECT_EQ("C:_foo_", Simplify("C:\\foo\\"));
34 EXPECT_EQ("", Simplify("\n\r\n\r\t\r")); 35 EXPECT_EQ("", Simplify("\n\r\n\r\t\r"));
35 } 36 }
36 37
37 TEST(PrintingUtilsTest, FormatDocumentTitleWithOwner) { 38 TEST(PrintingUtilsTest, FormatDocumentTitleWithOwner) {
38 EXPECT_EQ(": ", Format("", "")); 39 EXPECT_EQ(": ", Format("", ""));
39 EXPECT_EQ("abc: ", Format("abc", "")); 40 EXPECT_EQ("abc: ", Format("abc", ""));
40 EXPECT_EQ(": 123", Format("", "123")); 41 EXPECT_EQ(": 123", Format("", "123"));
41 EXPECT_EQ("abc: 123", Format("abc", "123")); 42 EXPECT_EQ("abc: 123", Format("abc", "123"));
42 EXPECT_EQ("abc: 0.9", Format("abc", "0123456789")); 43 EXPECT_EQ("abc: 0.9", Format("abc", "0123456789"));
43 EXPECT_EQ("ab...j: ", Format("abcdefghij", "123")); 44 EXPECT_EQ("ab...j: ", Format("abcdefghij", "123"));
45 EXPECT_EQ("xyz: _.o", Format("xyz", "\\f\\oo"));
44 EXPECT_EQ("ab...j: ", Format("abcdefghij", "0123456789")); 46 EXPECT_EQ("ab...j: ", Format("abcdefghij", "0123456789"));
45 } 47 }
46 48
47 } // namespace printing 49 } // namespace printing
48
OLDNEW
« no previous file with comments | « printing/printing_utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698