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

Unified Diff: chrome/browser/cocoa/ui_localizer_unittest.mm

Issue 155774: Starting mac l10n:... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 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: chrome/browser/cocoa/ui_localizer_unittest.mm
===================================================================
--- chrome/browser/cocoa/ui_localizer_unittest.mm (revision 0)
+++ chrome/browser/cocoa/ui_localizer_unittest.mm (revision 0)
@@ -0,0 +1,46 @@
+// Copyright (c) 2009 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.
+
+#import <Foundation/Foundation.h>
+
+#include "base/sys_string_conversions.h"
+#include "chrome/browser/cocoa/ui_localizer.h"
+#include "testing/gtest/include/gtest/gtest.h"
+#include "testing/platform_test.h"
+
+typedef PlatformTest UILocalizerTest;
+
+TEST_F(UILocalizerTest, FixUpWindowsStyleLabel) {
+ struct TestData {
+ NSString* input;
+ NSString* output;
+ };
+
+ TestData data[] = {
+ { @"", @"" },
+ { @"nothing", @"nothing" },
+ { @"foo &bar", @"foo bar" },
+ { @"foo &&bar", @"foo &bar" },
+ { @"foo &&&bar", @"foo &bar" },
+ { @"&foo &&bar", @"foo &bar" },
+ { @"&foo &bar", @"foo bar" },
+ { @"foo bar.", @"foo bar." },
+ { @"foo bar..", @"foo bar.." },
+ { @"foo bar...", @"foo bar\u2026" },
+ { @"foo.bar", @"foo.bar" },
+ { @"foo..bar", @"foo..bar" },
+ { @"foo...bar", @"foo\u2026bar" },
+ { @"foo...bar...", @"foo\u2026bar\u2026" },
+ };
+ for (size_t idx = 0; idx < ARRAYSIZE_UNSAFE(data) ; ++idx) {
Mark Mentovai 2009/07/21 21:23:52 Nit: consistency with spacing around ;s.
+ string16 input16(base::SysNSStringToUTF16(data[idx].input));
+
+ NSString* result = ui_localizer::FixUpWindowsStyleLabel(input16);
+ EXPECT_TRUE(result != nil) << "Fixup Failed, idx = " << idx;
+
+ EXPECT_TRUE([data[idx].output isEqualTo:result])
+ << "For idx " << idx << ", expected '" << [data[idx].output UTF8String]
+ << "', got '" << [result UTF8String] << "'";
+ }
+}
Property changes on: chrome/browser/cocoa/ui_localizer_unittest.mm
___________________________________________________________________
Name: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698