On Fri, 4 Apr 2025 21:05:52 GMT, Kevin Rushforth <k...@openjdk.org> wrote:
>> The reason I have prefix and postfix instead of what you are proposing is >> that in my case only one event is written to the output. This might be >> important when both stderr and stdout are redirected to the same log file, >> in which case it might produce an interleaved result. >> >> Also, prefix/postfix allow for more flexibility, such as outputting a JSON >> segment like >> >> { screenshot:"..." } >> >> or any other representation depending on the situation. > > To be clear, I agree that the caller is the one who should create the > representation you show above. What I object to is having the caller pass in > the first part of the data URL. That's not a clean separation of concerns. > > As for whether to keep the prefix / postfix _without_ the data URL part, I > don't care as much. I don't see it as needed, but it's fine if you want to > keep it. hmm, not sure if I share the concern (did I understand the concern?) the idea is to have a low-level method `takeScreenshotBase64(prefix, postfix)` that can be used in non-standard situations, but also provide the convenience method that will be used in the tests, `writeScreenshotBase64()`. ------------- PR Review Comment: https://git.openjdk.org/jfx/pull/1746#discussion_r2029437975