Created attachment 638225
revised with nsPrintfCString
> It might be better to simply return an empty string for all failure conditions.
Do you mean it should not even throw NS_NOT_IMPLEMENTED for non-XULWindows (i.e. nsDocShell and nsWebBrowser) and return an empty string instead ?
> You don't need to prefix ok() and is() with SimpleTest, do you?
Changed applied.
> Have you tested this on Windows? Visual C++ produces capital hex digits for %p.
> Maybe you should put a tolower method call somewhere so only lower-case digits
are returned by this API.
Created attachment 638225
revised with nsPrintfCString
> It might be better to simply return an empty string for all failure conditions.
Do you mean it should not even throw NS_NOT_IMPLEMENTED for non-XULWindows (i.e. nsDocShell and nsWebBrowser) and return an empty string instead ?
> You don't need to prefix ok() and is() with SimpleTest, do you?
Changed applied.
> Have you tested this on Windows? Visual C++ produces capital hex digits for %p.
> Maybe you should put a tolower method call somewhere so only lower-case digits
are returned by this API.
I haven't tested on Windows myself, but my last Try (https:/ /tbpl.mozilla. org/?tree= Try&rev= ad3559d462f6) and this test
ok(nativeHand le.match( /^0x[0- 9a-f]+$ /), "nativeHandle should have a memory address format");
tend to show that a tolower method call is not useful. nsPrintfCString uses PR_vsnprintf, which converts using lowercase digits.