I might be missing something, but it seems hard to write a strongly typed unit test for something that throws an exception. The best I can do is to return the exception value from one of the executeScriptAndReturnValue() helpers, and then stringify it like https://cs.chromium.org/chromium/src/third_party/WebKit/Source/web/tests/WebFrameTest.cpp?rcl=22f522e10dd7a816ec45547fd35a6fa0356b3d21&l=8842 does.
Normally, I would use a v8::TryCatch to check for an exception, but that's impossible, since ScriptController places a v8::TryCatch on the stack internally.
(Note: I'm not 100% sure if we should fix this or not. I know we've been encouraging more unit tests instead of layout tests, but unit tests also can't be easily shared between browsers...)
Comment 1 by peria@chromium.org
, Mar 2 2017Status: Available (was: Untriaged)