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.
Created attachment 228972 [details]
Created attachment 228976 [details]
Committed r167030: <http://trac.webkit.org/changeset/167030>