Bug 131446

Summary: [Win] Various DumpRenderTree Fixes
Product: WebKit Reporter: Brent Fulgham <bfulgham>
Component: Tools / TestsAssignee: Brent Fulgham <bfulgham>
Severity: Major    
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: All   
Description Flags
Patch thorton: review+

Description Brent Fulgham 2014-04-09 11:36:52 PDT
While investigating some flakiness in the Windows test runs, I found the following issues that needed to be addressed:

1. The logic that decides when to output raw text (rather than a RenderTree) does not match what happens on Mac. This caused tests to output render trees in some cases when raw text output was expected, resulting in test failures.
2. BSTR types were not consistently cleaned up, resulting in small memory leaks. Instead, we should be using the Visual Studio-supplied _bstr_t type, which encapsulates the data type and ensure proper creation/destruction.
3. BSTR types were being copied into new wstring values for the sole purpose of output to printf. This is not necessary, and should be done by an appropriate cast.
4. Hand-rolled routines to convert BSTR->JSStringRef or JSStringRef->BSTR should instead use the JS library-provided JSStringCreateWithBSTR or JSStringCopyBSTR, respectively.

This patch corrects these issues.
Comment 1 Brent Fulgham 2014-04-09 12:24:12 PDT
Created attachment 228972 [details]
Comment 2 Brent Fulgham 2014-04-09 13:11:06 PDT
Created attachment 228976 [details]
Comment 3 Brent Fulgham 2014-04-09 13:22:10 PDT
Committed r167030: <http://trac.webkit.org/changeset/167030>