Commit 39f22a4b authored by Mason Freed's avatar Mason Freed Committed by Commit Bot

Remove unnecessary checks for runtime enabled feature

Prior to [1], these tests were run with and without the
FormControlsRefresh feature enabled. Therefore, they needed to check
the state of the flag to alter their behavior. After [1], these
tests are only run with the feature enabled, and therefore do not
need to check.

TBR=wangxianzhu@chromium.org

[1] https://chromium-review.googlesource.com/c/chromium/src/+/1888124

Change-Id: I6704d3a8c2daab3eeefaabe22b6c5a8592b8c870
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1984698Reviewed-by: default avatarMason Freed <masonfreed@chromium.org>
Commit-Queue: Mason Freed <masonfreed@chromium.org>
Cr-Commit-Position: refs/heads/master@{#727847}
parent 2d26c687
......@@ -13,11 +13,7 @@
test(() => {
document.getElementById('date').focus();
eventSender.keyDown("Enter");
if (internals.runtimeFlags.formControlsRefreshEnabled) {
assert_not_equals(internals.pagePopupWindow, null);
} else {
assert_equals(internals.pagePopupWindow, null);
}
assert_not_equals(internals.pagePopupWindow, null);
}, "Test opening date picker with Enter key.");
</script>
......
......@@ -13,11 +13,7 @@
test(() => {
document.getElementById('date').focus();
eventSender.keyDown(" ");
if (internals.runtimeFlags.formControlsRefreshEnabled) {
assert_not_equals(internals.pagePopupWindow, null);
} else {
assert_equals(internals.pagePopupWindow, null);
}
assert_not_equals(internals.pagePopupWindow, null);
}, "Test opening date picker with Space key.");
</script>
......
......@@ -41,8 +41,6 @@ t.step(() => {
assert_equals(rValueContainer.value, '60');
assert_equals(gValueContainer.value, '144');
assert_equals(bValueContainer.value, '180');
}), t.step_func_done(() => {
assert_false(internals.runtimeFlags.formControlsRefreshEnabled, "Popup should only not open when the formControlsRefresh flag is disabled.");
}));
});
</script>
......
......@@ -35,8 +35,6 @@ t.step(() => {
assert_equals(rValueContainer.value, '69');
assert_equals(gValueContainer.value, '69');
assert_equals(bValueContainer.value, '69');
}), t.step_func_done(() => {
assert_false(internals.runtimeFlags.formControlsRefreshEnabled, "Popup should only not open when the formControlsRefresh flag is disabled.");
}));
});
</script>
......
......@@ -35,8 +35,6 @@ t.step(() => {
assert_equals(rValueContainer.value, '66');
assert_equals(gValueContainer.value, '0');
assert_equals(bValueContainer.value, '0');
}), t.step_func_done(() => {
assert_false(internals.runtimeFlags.formControlsRefreshEnabled, "Popup should only not open when the formControlsRefresh flag is disabled.");
}));
});
</script>
......
......@@ -42,8 +42,6 @@ t.step(() => {
assert_equals(rValueContainer.value, '123');
assert_equals(gValueContainer.value, '50');
assert_equals(bValueContainer.value, '93');
}), t.step_func_done(() => {
assert_false(internals.runtimeFlags.formControlsRefreshEnabled, "Popup should only not open when the formControlsRefresh flag is disabled.");
}));
});
</script>
......
......@@ -35,8 +35,6 @@ t.step(() => {
assert_equals(rValueContainer.value, '0');
assert_equals(gValueContainer.value, '0');
assert_equals(bValueContainer.value, '0');
}), t.step_func_done(() => {
assert_false(internals.runtimeFlags.formControlsRefreshEnabled, "Popup should only not open when the formControlsRefresh flag is disabled.");
}));
});
</script>
......
......@@ -35,8 +35,6 @@ t.step(() => {
assert_equals(rValueContainer.value, '255');
assert_equals(gValueContainer.value, '112');
assert_equals(bValueContainer.value, '112');
}), t.step_func_done(() => {
assert_false(internals.runtimeFlags.formControlsRefreshEnabled, "Popup should only not open when the formControlsRefresh flag is disabled.");
}));
});
</script>
......
......@@ -35,8 +35,6 @@ t.step(() => {
assert_equals(rValueContainer.value, '0');
assert_equals(gValueContainer.value, '0');
assert_equals(bValueContainer.value, '0');
}), t.step_func_done(() => {
assert_false(internals.runtimeFlags.formControlsRefreshEnabled, "Popup should only not open when the formControlsRefresh flag is disabled.");
}));
});
</script>
......
......@@ -35,8 +35,6 @@ t.step(() => {
assert_equals(rValueContainer.value, '255');
assert_equals(gValueContainer.value, '143');
assert_equals(bValueContainer.value, '143');
}), t.step_func_done(() => {
assert_false(internals.runtimeFlags.formControlsRefreshEnabled, "Popup should only not open when the formControlsRefresh flag is disabled.");
}));
});
</script>
......
......@@ -35,8 +35,6 @@ t.step(() => {
assert_equals(rValueContainer.value, '186');
assert_equals(gValueContainer.value, '186');
assert_equals(bValueContainer.value, '186');
}), t.step_func_done(() => {
assert_false(internals.runtimeFlags.formControlsRefreshEnabled, "Popup should only not open when the formControlsRefresh flag is disabled.");
}));
});
</script>
......
......@@ -35,8 +35,6 @@ t.step(() => {
assert_equals(rValueContainer.value, '189');
assert_equals(gValueContainer.value, '0');
assert_equals(bValueContainer.value, '0');
}), t.step_func_done(() => {
assert_false(internals.runtimeFlags.formControlsRefreshEnabled, "Popup should only not open when the formControlsRefresh flag is disabled.");
}));
});
</script>
......
......@@ -28,8 +28,6 @@ t.step(() => {
eventSender.mouseDown();
eventSender.mouseUp();
assert_false(didColorWellSelectionRingMove(colorWellSelectionRingOriginalRect, colorWellSelectionRing.getBoundingClientRect()), "Color well selection ring should not have moved after it was focused via click.");
}), t.step_func_done(() => {
assert_false(internals.runtimeFlags.formControlsRefreshEnabled, "Popup should only not open when the formControlsRefresh flag is disabled.");
}));
});
......
......@@ -54,8 +54,6 @@ t.step(() => {
assert_equals(hexValueContainer.value, '');
eventSender.keyDown('Tab');
assert_equals(hexValueContainer.value, '#00000a', 'Invalid value should be reset when the value container is blurred.');
}), t.step_func_done(() => {
assert_false(internals.runtimeFlags.formControlsRefreshEnabled, "Popup should only not open when the formControlsRefresh flag is disabled.");
}));
});
</script>
......
......@@ -34,8 +34,6 @@ t.step(() => {
eventSender.keyDown('Tab');
assert_equals(popupDocument.activeElement, bValueContainer, 'bValueContainer should be the active element');
assert_equals(bValueContainer.value, '255', 'bValueContainer\'s value should not have changed');
}), t.step_func_done(() => {
assert_false(internals.runtimeFlags.formControlsRefreshEnabled, "Popup should only not open when the formControlsRefresh flag is disabled.");
}));
});
</script>
......
......@@ -25,8 +25,6 @@ t.step(() => {
eventSender.keyDown('ArrowDown', ['ctrlKey']);
}
assert_equals(hexValueContainer.value, '#000000', 'Selected color value should be \'#000000\'');
}), t.step_func_done(() => {
assert_false(internals.runtimeFlags.formControlsRefreshEnabled, "Popup should only not open when the formControlsRefresh flag is disabled.");
}));
});
</script>
......
......@@ -39,10 +39,8 @@ t.step(() => {
assert_true(colorSwatchHeight.trim() === '0' || colorSwatchHeight.endsWith('px'), 'Color swatch height must be 0 or end in \'px\'');
assert_true(colorSwatchPadding.trim() === '0' || colorSwatchPadding.endsWith('px'), 'Color swatch padding must be 0 or end in \'px\'');
assert_true(colorSwatchWidth.trim() === '0' || colorSwatchWidth.endsWith('px'), 'Color swatch width must be 0 or end in \'px\'');
if (internals.runtimeFlags.formControlsRefreshEnabled) {
const scrollbarWidth = popupWindow.getComputedStyle(popupDocumentBody).getPropertyValue('--scrollbar-width');
assert_true(scrollbarWidth.trim() === '0' || scrollbarWidth.endsWith('px'), 'Scrollbar width must be 0 or end in \'px\'');
}
const scrollbarWidth = popupWindow.getComputedStyle(popupDocumentBody).getPropertyValue('--scrollbar-width');
assert_true(scrollbarWidth.trim() === '0' || scrollbarWidth.endsWith('px'), 'Scrollbar width must be 0 or end in \'px\'');
}));
});
</script>
......
......@@ -14,10 +14,6 @@
let t = async_test('Test cancel select value in datetime-local popup');
function selectValue() {
if (!internals.runtimeFlags.formControlsRefreshEnabled) {
t.done();
}
let dateTimeElement = document.getElementById("datetime-local");
clickDayCellAt(3, 4);
clickTimeCellAt(0, 4);
......
......@@ -14,10 +14,6 @@
let t = async_test('Test select value in datetime-local popup');
function selectValue() {
if (!internals.runtimeFlags.formControlsRefreshEnabled) {
t.done();
}
let dateTimeElement = document.getElementById("datetime-local");
dateTimeElement.addEventListener("change", t.step_func_done(() => {
assert_equals(dateTimeElement.value, "2019-02-27T17:03");
......
......@@ -51,9 +51,7 @@ function cancelSelectValue() {
}
t.step(() => {
openPicker(document.getElementById('time'), t.step_func(cancelSelectValue), t.step_func_done(() => {
assert_false(internals.runtimeFlags.formControlsRefreshEnabled, "Popup did not open.");
}));
openPicker(document.getElementById('time'), t.step_func(cancelSelectValue));
});
</script>
</body>
......
......@@ -23,9 +23,7 @@ function cancelSelectValue() {
}
t.step(() => {
openPicker(document.getElementById('time'), t.step_func(cancelSelectValue), t.step_func_done(() => {
assert_false(internals.runtimeFlags.formControlsRefreshEnabled, "Popup did not open.");
}));
openPicker(document.getElementById('time'), t.step_func(cancelSelectValue));
});
</script>
</body>
......
......@@ -26,9 +26,7 @@ function selectValue() {
}
t.step(() => {
openPicker(document.getElementById('time'), t.step_func(selectValue), t.step_func_done(() => {
assert_false(internals.runtimeFlags.formControlsRefreshEnabled, "Popup did not open.");
}));
openPicker(document.getElementById('time'), t.step_func(selectValue));
});
</script>
</body>
......
......@@ -27,9 +27,7 @@ function selectValue() {
}
t.step(() => {
openPicker(document.getElementById('time'), t.step_func(selectValue), t.step_func_done(() => {
assert_false(internals.runtimeFlags.formControlsRefreshEnabled, "Popup did not open.");
}));
openPicker(document.getElementById('time'), t.step_func(selectValue));
});
</script>
</body>
......
......@@ -28,9 +28,7 @@ function selectValue() {
}
t.step(() => {
openPicker(document.getElementById('time'), t.step_func(selectValue), t.step_func_done(() => {
assert_false(internals.runtimeFlags.formControlsRefreshEnabled, "Popup did not open.");
}));
openPicker(document.getElementById('time'), t.step_func(selectValue));
});
</script>
</body>
......
......@@ -27,9 +27,7 @@ function selectValue() {
}
t.step(() => {
openPicker(document.getElementById('time'), t.step_func(selectValue), t.step_func_done(() => {
assert_false(internals.runtimeFlags.formControlsRefreshEnabled, "Popup did not open.");
}));
openPicker(document.getElementById('time'), t.step_func(selectValue));
});
</script>
</body>
......
......@@ -31,9 +31,7 @@ function selectValue() {
}
t.step(() => {
openPicker(document.getElementById('time'), t.step_func(selectValue), t.step_func_done(() => {
assert_false(internals.runtimeFlags.formControlsRefreshEnabled, "Popup did not open.");
}));
openPicker(document.getElementById('time'), t.step_func(selectValue));
});
</script>
</body>
......
......@@ -25,9 +25,7 @@ function selectValue() {
}
t.step(() => {
openPicker(document.getElementById('time'), t.step_func(selectValue), t.step_func_done(() => {
assert_false(internals.runtimeFlags.formControlsRefreshEnabled, "Popup did not open.");
}));
openPicker(document.getElementById('time'), t.step_func(selectValue));
});
</script>
</body>
......
......@@ -25,9 +25,7 @@ function selectValue() {
}
t.step(() => {
openPicker(document.getElementById('time'), t.step_func(selectValue), t.step_func_done(() => {
assert_false(internals.runtimeFlags.formControlsRefreshEnabled, "Popup did not open.");
}));
openPicker(document.getElementById('time'), t.step_func(selectValue));
});
</script>
</body>
......
......@@ -25,9 +25,7 @@ function selectValue() {
}
t.step(() => {
openPicker(document.getElementById('time'), t.step_func(selectValue), t.step_func_done(() => {
assert_false(internals.runtimeFlags.formControlsRefreshEnabled, "Popup did not open.");
}));
openPicker(document.getElementById('time'), t.step_func(selectValue));
});
</script>
</body>
......
......@@ -27,9 +27,7 @@ function selectValue() {
}
t.step(() => {
openPicker(document.getElementById('time'), t.step_func(selectValue), t.step_func_done(() => {
assert_false(internals.runtimeFlags.formControlsRefreshEnabled, "Popup did not open.");
}));
openPicker(document.getElementById('time'), t.step_func(selectValue));
});
</script>
</body>
......
......@@ -49,9 +49,7 @@ function selectValue() {
}
t.step(() => {
openPicker(document.getElementById('time'), t.step_func(selectValue), t.step_func_done(() => {
assert_false(internals.runtimeFlags.formControlsRefreshEnabled, "Popup did not open.");
}));
openPicker(document.getElementById('time'), t.step_func(selectValue));
});
</script>
</body>
......
......@@ -24,9 +24,7 @@ function selectValue() {
}
t.step(() => {
openPicker(document.getElementById('time'), t.step_func(selectValue), t.step_func_done(() => {
assert_false(internals.runtimeFlags.formControlsRefreshEnabled, "Popup did not open.");
}));
openPicker(document.getElementById('time'), t.step_func(selectValue));
});
</script>
</body>
......
......@@ -32,7 +32,5 @@ function test1() {
}, 200);
}
openPicker(document.getElementById('time'), t.step_func(test1), t.step_func_done(() => {
assert_false(internals.runtimeFlags.formControlsRefreshEnabled, "Popup did not open.");
}));
openPicker(document.getElementById('time'), t.step_func(test1));
</script>
\ No newline at end of file
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