WebJsTest::LoadHtmlAndInject doesn't fail on missing JavaScript file. |
|||||
Issue descriptionWhat steps will reproduce the problem? (1)Create a web::WebJsTest with JavaScript file which exists but is not added in BUILD.gn; (2)Call web::WebJsTest::LoadHtmlAndInject in the unittest; (3)Run the unittest; (4)The JavaScript file is not injected, and no error or exception appears. What is the expected result? web::WebJsTest::LoadHtmlAndInject should return false or throw exception for JavaScript file not found. What happens instead? Nothing happened, and every test case about that JavaScript file would fail. Code ref: https://cs.chromium.org/chromium/src/ios/web/public/test/web_js_test.h?rcl=d2fc8d1b79b5e61c56bbc52e7604757a79847850&l=72
,
Jul 31
,
Jul 31
Returning a bool and adding WARN_UNUSED_RESULT would be a great improvement for LoadHtmlAndInject
,
Aug 1
After https://chromium-review.googlesource.com/c/chromium/src/+/1136301 WebJsTest will DCHECK is content is empty (as all other instances of GetPageScript). Is that acceptable?
,
Aug 1
DCHECKing in the test is not great, because DCHECK fails the whole test suite instead of a single test. Returning boolean from a helper and calling ASSERT or EXPECT in the test seems like a better option.
,
Oct 26
,
Oct 26
,
Oct 26
|
|||||
►
Sign in to add a comment |
|||||
Comment 1 by olivierrobin@chromium.org
, Jul 27Owner: olivierrobin@chromium.org
Status: Assigned (was: Untriaged)