[DevTools] Assert that the console text ends with exactly the low surrogate.
In |step5|, |text| ends with a UTF16 low surrogate, so text is invalid Unicode, and this is as designed, since the Javascript console must be able to deal with invalid Unicode as Javascript allows unbalanced surrogate characters. Unfortunately, the test only asserted the number of UTF16 characters, not the actual characters preserved. Now we assert that |text| ends with a particular character, '\uD835' which is a low surrogate, the exact same one that was second to last in the original input |str| in TestRunner.evaluateInPagePromise(...) above. The test will thus fail if somehow this invalid UTF16 payload runs through a UTF8 transcoder and back, as such transcoders have no way to preserve unbalanced surrogate pairs - they will typically replace them with a mark for "invalid character", so then what comes back in |text| is valid UTF16, which won't have a hanging low surrogate. Change-Id: I0efedc84f6eb4f6570714e67e49ee44ffa309a7f Reviewed-on: https://chromium-review.googlesource.com/c/1481952 Auto-Submit: Johannes Henkel <johannes@chromium.org> Reviewed-by:Andrey Kosyakov <caseq@chromium.org> Commit-Queue: Andrey Kosyakov <caseq@chromium.org> Cr-Commit-Position: refs/heads/master@{#634433}
Showing
Please register or sign in to comment