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

Issue 9641017: Add PrintTo for string16 (Closed)

Created:
8 years, 9 months ago by gab
Modified:
8 years, 9 months ago
Reviewers:
brettw
CC:
chromium-reviews, jshin+watch_chromium.org, brettw-cc_chromium.org, Alexei Svitkine (slow)
Visibility:
Public.

Description

Add PrintTo for string16 This is required by googletest to print a readable output when failing to compare two string16's (ref: http://goo.gl/jALbO) Without this the output of a failed comparison could be: Value of: ElideEmail(UTF8ToUTF16(testcases[i].input), font, font.GetStringWidth(expected_output)) Actual: { 97, 116, 34, 64, 64, 64, 64, 64, 64, 64, 64, 64, 46, 46, 46, 64, 64, 46, 8230, 64, 109, 97, 100, 110, 101, 115, 115, 46, 99, 111, 109 } Expected: expected_output Which is: { 97, 116, 34, 64, 64, 64, 64, 64, 64, 64, 64, 64, 46, 46, 46, 64, 64, 46, 64, 46, 8230, 64, 109, 97, 110, 101, 115, 115, 46, 99, 111, 109 } With this patch the same error is now properly formatted: Value of: ElideEmail(UTF8ToUTF16(testcases[i].input), font, font.GetStringWidth(expected_output)) Actual: at"@@@@@@@@@...@@.…@madness.com Expected: expected_output Which is: at"@@@@@@@@@...@@.@.…@maness.com BUG= TEST=unit_tests Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=125642

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+7 lines, -0 lines) Patch
M base/string16.h View 1 chunk +3 lines, -0 lines 0 comments Download
M base/string16.cc View 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
gab
PTAL
8 years, 9 months ago (2012-03-08 14:48:36 UTC) #1
brettw
lgtm
8 years, 9 months ago (2012-03-08 15:30:22 UTC) #2
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/gab@chromium.org/9641017/1
8 years, 9 months ago (2012-03-08 15:35:03 UTC) #3
commit-bot: I haz the power
8 years, 9 months ago (2012-03-08 18:34:52 UTC) #4
Change committed as 125642

Powered by Google App Engine
This is Rietveld 408576698