Commit b8a82b57 authored by Olivier Robin's avatar Olivier Robin Committed by Commit Bot

Retain config in WKWebViewConfigurationProviderTest.Purge

On release build, the weak config is deallocated even before the
ASSERT_TRUE.
Add a strong variable to retain it at least in the autoreleasepool.

Note that this test does not test the deletion of the config in the
Purge method as GetWebViewConfiguration returns a copy.

Bug: None
Change-Id: If3e21c3bab53c35859ed1b70c3b207966a02813f
Reviewed-on: https://chromium-review.googlesource.com/579430
Commit-Queue: Olivier Robin <olivierrobin@chromium.org>
Reviewed-by: default avatarStepan Khapugin <stkhapugin@chromium.org>
Reviewed-by: default avatarEugene But <eugenebut@chromium.org>
Cr-Commit-Position: refs/heads/master@{#488260}
parent 7c6649db
...@@ -122,7 +122,8 @@ TEST_F(WKWebViewConfigurationProviderTest, Purge) { ...@@ -122,7 +122,8 @@ TEST_F(WKWebViewConfigurationProviderTest, Purge) {
__weak id config; __weak id config;
__weak id router; __weak id router;
@autoreleasepool { // Make sure that resulting copy is deallocated. @autoreleasepool { // Make sure that resulting copy is deallocated.
config = GetProvider().GetWebViewConfiguration(); id strong_config = GetProvider().GetWebViewConfiguration();
config = strong_config;
router = GetProvider().GetScriptMessageRouter(); router = GetProvider().GetScriptMessageRouter();
ASSERT_TRUE(config); ASSERT_TRUE(config);
ASSERT_TRUE(router); ASSERT_TRUE(router);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment