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

Unified Diff: printing/backend/print_backend_unittest.cc

Issue 10941025: Simplify document title for Windows printing. (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 side-by-side diff with in-line comments
Download patch
Index: printing/backend/print_backend_unittest.cc
diff --git a/printing/backend/print_backend_unittest.cc b/printing/backend/print_backend_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..5b0517970b866efbf0993d322ed21fae384cfe47
--- /dev/null
+++ b/printing/backend/print_backend_unittest.cc
@@ -0,0 +1,22 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "printing/backend/print_backend.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace printing {
+
+TEST(PrintBackendTest, SimplifyDocumentTitle) {
+ EXPECT_STREQ(L"", PrintBackend::SimplifyDocumentTitle(L"").c_str());
+ EXPECT_STREQ(L"Document wi...oooong name",
+ PrintBackend::SimplifyDocumentTitle(
+ L"Document with very looooooooooong name").c_str());
+ EXPECT_STREQ(L"Control Characters",
+ PrintBackend::SimplifyDocumentTitle(
+ L"C\ron\ntrol Charac\15ters").c_str());
+ EXPECT_STREQ(L"",
+ PrintBackend::SimplifyDocumentTitle(L"\n\r\n\r\x9F\r").c_str());
+}
+
+} // namespace printing

Powered by Google App Engine
This is Rietveld 408576698