OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "printing/backend/print_backend.h" |
| 6 #include "base/utf_string_conversions.h" |
| 7 #include "testing/gtest/include/gtest/gtest.h" |
| 8 |
| 9 namespace printing { |
| 10 |
| 11 std::string Simplify(const char* title) { |
| 12 return UTF16ToUTF8(PrintBackend::SimplifyDocumentTitle(ASCIIToUTF16(title))); |
| 13 } |
| 14 |
| 15 TEST(PrintBackendTest, SimplifyDocumentTitle) { |
| 16 EXPECT_STREQ("", Simplify("").c_str()); |
| 17 EXPECT_STREQ("Document wi...oooong name", |
| 18 Simplify("Document with very looooooooooong name").c_str()); |
| 19 EXPECT_STREQ("Control Characters", |
| 20 Simplify("C\ron\ntrol Charac\15ters").c_str()); |
| 21 EXPECT_STREQ("", Simplify("\n\r\n\r\t\r").c_str()); |
| 22 } |
| 23 |
| 24 } // namespace printing |
| 25 |
OLD | NEW |