Determine if tab_usage_recorder_egtests needed |
|||
Issue descriptionThese tests do a lot with tab eviction, which has been greatly refactored, so we first want to make sure the tests in this file are useful. There are a lot of unit tests, so could these be sufficient and we delete the EG tests? The tests also block arc conversion, because importing a private header, which worked okay under non-ARC since a forward declaration was sufficient.
,
Jun 7 2017
Overall, even though there are unit tests, the TabUsageRecorder eg tests would catch integration bugs. Most of the tests verify that a metric is collected after certain user actions. Additionally, a few verify that the tab reloads after an eviction. One issue with the tests is that they exercise code paths that cannot be reached by the user. Specifically, OpenNewIncognitoTabUsingUIAndEvictMainTabs() is used throughout to evict tabs and open tabs in incognito. This method was created originally because switching modes used to cause tab eviction. This is no longer the case, and the only ways that tabs can be evicted is by termination of the renderer process (and the purging of Chrome in the background, implicitly). To make the tests more accurate, they instead could use something like SimulateWKWebViewCrash(WKWebView* webView) in wk_web_view_crash_utils.h to cause eviction. There are a few tests that can be removed: testing that opening new tab does not cause eviction, and opening tab from app does not cause eviction.
,
Jun 7 2017
Thanks Gregory! So that would we using a different private API, since SimulateWKWebViewCrash is in ios/web/test. Eugene, switching the the method that Gregory suggested would match more the intent of the test, but it may be leaking too much private stuff. Here are a few questions guiding the next steps... Would we not want to expose SimulatWKWebViewCrash in ios/web/public/test? Without exposing something, we can't do any tests with evicted tabs, are we okay with that? Or make a method that evicts tabs, which can do it by whatever means works? This is blocking some ARC conversions, so I think we should do something quickly (DEPS exclusion, move method to ios/web/public/test, delete the tests), but I also want to make sure we don't do anything terrible.
,
Jun 7 2017
,
Jun 8 2017
Eugene, no need to respond now. I need to investigate if the cause of this bug is necessary before we make a decision. I'll ping the bug then.
,
Jun 14 2017
,
Jun 14 2017
From various discussions, we decided the tests are necessary, and a DEPS exception was added to allow ARC conversion to go forward. |
|||
►
Sign in to add a comment |
|||
Comment 1 by baxley@chromium.org
, May 17 2017Status: Assigned (was: Available)