New issue
Advanced search Search tips

Issue 693985 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Task



Sign in to add a comment

Make it possible to write C++ unit tests that throw exceptions

Project Member Reported by dcheng@chromium.org, Feb 19 2017

Issue description

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 2017

Labels: -Type-Bug Type-Task
Status: Available (was: Untriaged)
Project Member

Comment 2 by sheriffbot@chromium.org, Mar 7 2018

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available. If you change it back, also remove the "Hotlist-Recharge-Cold" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 3 by peria@chromium.org, Mar 11 2018

Labels: -Pri-2 Pri-3
Status: Available (was: Untriaged)

Comment 4 by ojan@chromium.org, May 8 2018

Cc: -ojan@chromium.org

Sign in to add a comment