| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #import <Foundation/Foundation.h> | 5 #import <Foundation/Foundation.h> |
| 6 | 6 |
| 7 #include "base/strings/sys_string_conversions.h" | 7 #include "base/strings/sys_string_conversions.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 #include "testing/platform_test.h" | 9 #include "testing/platform_test.h" |
| 10 #include "ui/base/l10n/l10n_util_mac.h" | 10 #include "ui/base/l10n/l10n_util_mac.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 { @"foo bar...", @"foo bar\u2026" }, | 30 { @"foo bar...", @"foo bar\u2026" }, |
| 31 { @"foo.bar", @"foo.bar" }, | 31 { @"foo.bar", @"foo.bar" }, |
| 32 { @"foo..bar", @"foo..bar" }, | 32 { @"foo..bar", @"foo..bar" }, |
| 33 { @"foo...bar", @"foo\u2026bar" }, | 33 { @"foo...bar", @"foo\u2026bar" }, |
| 34 { @"foo...bar...", @"foo\u2026bar\u2026" }, | 34 { @"foo...bar...", @"foo\u2026bar\u2026" }, |
| 35 { @"foo(&b)", @"foo" }, | 35 { @"foo(&b)", @"foo" }, |
| 36 { @"foo(&b)...", @"foo\u2026" }, | 36 { @"foo(&b)...", @"foo\u2026" }, |
| 37 { @"(&b)foo", @"foo" }, | 37 { @"(&b)foo", @"foo" }, |
| 38 }; | 38 }; |
| 39 for (size_t idx = 0; idx < ARRAYSIZE_UNSAFE(data); ++idx) { | 39 for (size_t idx = 0; idx < ARRAYSIZE_UNSAFE(data); ++idx) { |
| 40 string16 input16(base::SysNSStringToUTF16(data[idx].input)); | 40 base::string16 input16(base::SysNSStringToUTF16(data[idx].input)); |
| 41 | 41 |
| 42 NSString* result = l10n_util::FixUpWindowsStyleLabel(input16); | 42 NSString* result = l10n_util::FixUpWindowsStyleLabel(input16); |
| 43 EXPECT_TRUE(result != nil) << "Fixup Failed, idx = " << idx; | 43 EXPECT_TRUE(result != nil) << "Fixup Failed, idx = " << idx; |
| 44 | 44 |
| 45 EXPECT_TRUE([data[idx].output isEqual:result]) | 45 EXPECT_TRUE([data[idx].output isEqual:result]) |
| 46 << "For idx " << idx << ", expected '" << [data[idx].output UTF8String] | 46 << "For idx " << idx << ", expected '" << [data[idx].output UTF8String] |
| 47 << "', got '" << [result UTF8String] << "'"; | 47 << "', got '" << [result UTF8String] << "'"; |
| 48 } | 48 } |
| 49 } | 49 } |
| OLD | NEW |