Bug 120438

Summary: LayoutTests on Windows debug fails and exits early on dom/html/level2/html/AppletsCollection.html
Product: WebKit Reporter: Roger Fong <roger_fong>
Component: Tools / TestsAssignee: Brent Fulgham <bfulgham>
Status: RESOLVED FIXED    
Severity: Normal CC: andersca, bfulgham, roger_fong, thorton
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Windows 7   
Attachments:
Description Flags
Patch thorton: review+

Description Roger Fong 2013-08-28 14:56:19 PDT
Error message here:
13:48:43.089 2308 worker/2 dom/html/level2/html/AppletsCollection.html crashed, (stderr lines):
13:48:43.089 2308   ASSERTION FAILED: could not find localizable string The plug-in can�t be found in bundle
13:48:43.089 2308   result.get() != notFound
13:48:43.089 2308   ..\platform\win\LocalizedStringsWin.cpp(53) : WebCore::localizedString

Regression at: http://trac.webkit.org/changeset/154764
Comment 1 Brent Fulgham 2013-08-28 16:27:07 PDT
Created attachment 209929 [details]
Patch
Comment 2 Tim Horton 2013-08-28 16:32:52 PDT
Comment on attachment 209929 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=209929&action=review

> Source/WebKit/win/ChangeLog:3
> +        [Windows] LayoutTests on Windows dbug fails and exits early

debug?

> Source/WebKit/win/ChangeLog:9
> +        escape non-ASCII characters so the byte stream is correct for localized

Are smart quotes usually used in the UI on Windows?
Comment 3 Brent Fulgham 2013-08-28 16:37:02 PDT
There's a good write-up about why this problem happened here: http://cboard.cprogramming.com/cplusplus-programming/145590-non-english-characters-cout-2.html#post1086757

Basically, Visual Studio assumes any narrow-character arrays contain only local encoding (e.g., ASCII in this case). It takes anything that doesn't fall into that category and spits it out as '?'.  When that happens, our localized string lookup fails and we get the assertion.

I didn't notice this because I run my tests in Release mode.  :-(
Comment 4 Brent Fulgham 2013-08-28 16:37:53 PDT
(In reply to comment #2)
> (From update of attachment 209929 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=209929&action=review
> 
> > Source/WebKit/win/ChangeLog:3
> > +        [Windows] LayoutTests on Windows dbug fails and exits early
> 
> debug?

Drat!

> > Source/WebKit/win/ChangeLog:9
> > +        escape non-ASCII characters so the byte stream is correct for localized
> 
> Are smart quotes usually used in the UI on Windows?

It depends on the application.  Here I want to just use the existing localized strings so that we can reuse any localized version of the WebKit strings file without having to retranslate it.
Comment 5 Brent Fulgham 2013-08-28 16:39:57 PDT
Committed r154790: <http://trac.webkit.org/changeset/154790>