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

Side by Side Diff: ui/base/l10n/l10n_util_mac_unittest.mm

Issue 6409039: Menu item titles include Windows-style accelerator marker.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 9 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 | Annotate | Revision Log
« no previous file with comments | « ui/base/l10n/l10n_util_mac.mm ('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 (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/sys_string_conversions.h" 7 #include "base/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 14 matching lines...) Expand all
25 { @"foo &&&bar", @"foo &bar" }, 25 { @"foo &&&bar", @"foo &bar" },
26 { @"&foo &&bar", @"foo &bar" }, 26 { @"&foo &&bar", @"foo &bar" },
27 { @"&foo &bar", @"foo bar" }, 27 { @"&foo &bar", @"foo bar" },
28 { @"foo bar.", @"foo bar." }, 28 { @"foo bar.", @"foo bar." },
29 { @"foo bar..", @"foo bar.." }, 29 { @"foo bar..", @"foo bar.." },
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" },
36 { @"foo(&b)...", @"foo\u2026" },
TVL 2011/02/03 13:39:42 include a test case where the accelerator is at th
Takashi Toyoshima (Google) 2011/02/04 20:28:06 Done.
35 }; 37 };
36 for (size_t idx = 0; idx < ARRAYSIZE_UNSAFE(data); ++idx) { 38 for (size_t idx = 0; idx < ARRAYSIZE_UNSAFE(data); ++idx) {
37 string16 input16(base::SysNSStringToUTF16(data[idx].input)); 39 string16 input16(base::SysNSStringToUTF16(data[idx].input));
38 40
39 NSString* result = l10n_util::FixUpWindowsStyleLabel(input16); 41 NSString* result = l10n_util::FixUpWindowsStyleLabel(input16);
40 EXPECT_TRUE(result != nil) << "Fixup Failed, idx = " << idx; 42 EXPECT_TRUE(result != nil) << "Fixup Failed, idx = " << idx;
41 43
42 EXPECT_TRUE([data[idx].output isEqualTo:result]) 44 EXPECT_TRUE([data[idx].output isEqualTo:result])
43 << "For idx " << idx << ", expected '" << [data[idx].output UTF8String] 45 << "For idx " << idx << ", expected '" << [data[idx].output UTF8String]
44 << "', got '" << [result UTF8String] << "'"; 46 << "', got '" << [result UTF8String] << "'";
45 } 47 }
46 } 48 }
OLDNEW
« no previous file with comments | « ui/base/l10n/l10n_util_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698