$cache_context_tags = \Drupal::
service('cache_contexts_manager'
)->
convertTokensToKeys($cache_contexts)->
getCacheTags();
// Test before there are any nodes.
$empty_node_listing_cache_tags =
[ 'config:views.view.frontpage',
'node_list',
];
$render_cache_tags = Cache::
mergeTags($empty_node_listing_cache_tags,
$cache_context_tags);
$this->
assertViewsCacheTags( $view,
$empty_node_listing_cache_tags,
$do_assert_views_caches,
$render_cache_tags );
$expected_tags = Cache::
mergeTags($empty_node_listing_cache_tags,
$cache_context_tags);
$expected_tags = Cache::
mergeTags($expected_tags,
['http_response', 'rendered', 'config:user.role.anonymous'
]);
$this->
assertPageCacheContextsAndTags( Url::
fromRoute('view.frontpage.page_1'
),
$cache_contexts,
$expected_tags );