Commit 94036062 authored by dpapad's avatar dpapad Committed by Commit Bot

Settings WebUI: Fix CrSettingsIncompatibleApplicationsPageTest with Polymer 2.

The test was failing because it was asserting on a DOM subtree that was behind a
<dom-if> that is false. In Polymer 2, a new optimization prevents those parts of
the DOM to receive any updates.

Bug: 896208
Change-Id: I268b6732ccf75f5544b3ce3011a73fbc8d11f55b
Reviewed-on: https://chromium-review.googlesource.com/c/1287199Reviewed-by: default avatarRebekah Potter <rbpotter@chromium.org>
Commit-Queue: Demetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#600622}
parent 4f1e56c0
......@@ -98,6 +98,17 @@ suite('incompatibleApplicationsHandler', function() {
* @param {!Array<settings.IncompatibleApplication>}
*/
function validateList(incompatibleApplications) {
if (incompatibleApplications.length === 0) {
const list =
incompatibleApplicationsPage.$$('#incompatible-applications-list');
assertEquals('none', list.style.display);
// The contents of a dom-if that is false no longer receive updates in
// Polymer 2. When there are no applications the parent dom-if becomes
// false, so only check that the list is hidden, but don't assert on
// number of DOM children.
return;
}
const list = incompatibleApplicationsPage.shadowRoot.querySelectorAll(
'.incompatible-application:not([hidden])');
......
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