From 0038aea648bf636d332d848c6bf8ca4f4c819b9c Mon Sep 17 00:00:00 2001 From: Bogdan Tara Date: Fri, 13 Nov 2020 04:20:11 +0200 Subject: [PATCH] Backed out changeset 762270e639cf (bug 1676078) for browser_datetime_datepicker.js failures CLOSED TREE --- .../browser/browser_datetime_datepicker.js | 17 ++++++++--------- toolkit/content/tests/browser/head.js | 7 ------- toolkit/content/widgets/datepicker.js | 1 - 3 files changed, 8 insertions(+), 17 deletions(-) diff --git a/toolkit/content/tests/browser/browser_datetime_datepicker.js b/toolkit/content/tests/browser/browser_datetime_datepicker.js index 223f47335c82..c1f7e9406d10 100644 --- a/toolkit/content/tests/browser/browser_datetime_datepicker.js +++ b/toolkit/content/tests/browser/browser_datetime_datepicker.js @@ -266,8 +266,6 @@ add_task(async function test_datepicker_keyboard_open() { "waiting for open" ); - let valueSet = helper.promisePickerValueSet(); - // NOTE: After the click, the first input field (the month one) is focused, // so down arrow will change the selected month. // @@ -275,13 +273,14 @@ add_task(async function test_datepicker_keyboard_open() { // DATE_FORMAT and other bits around do the same). BrowserTestUtils.synthesizeKey("VK_DOWN", {}, browser); - await valueSet; - - is( - helper.getElement(MONTH_YEAR).textContent, - DATE_FORMAT(new Date(prevMonth)), - "Should update date when updating months" - ); + // It'd be good to use something else than waitForCondition for this but + // there's no exposed event atm when the value changes from the child. + await BrowserTestUtils.waitForCondition(() => { + return ( + helper.getElement(MONTH_YEAR).textContent == + DATE_FORMAT(new Date(prevMonth)) + ); + }, "Should update date when updating months"); await helper.tearDown(); }); diff --git a/toolkit/content/tests/browser/head.js b/toolkit/content/tests/browser/head.js index fae2443623f0..8973f1a6b4c4 100644 --- a/toolkit/content/tests/browser/head.js +++ b/toolkit/content/tests/browser/head.js @@ -214,13 +214,6 @@ class DateTimeTestHelper { await readyPromise; } - promisePickerValueSet() { - return BrowserTestUtils.waitForEvent( - this.frame.contentDocument, - "PickerValueWasSet" - ); - } - /** * Find an element on the picker. * diff --git a/toolkit/content/widgets/datepicker.js b/toolkit/content/widgets/datepicker.js index ea6bd662f086..193e896ac8bc 100644 --- a/toolkit/content/widgets/datepicker.js +++ b/toolkit/content/widgets/datepicker.js @@ -315,7 +315,6 @@ function DatePicker(context) { day, }); this._update({ noSmoothScroll: true }); - document.dispatchEvent(new CustomEvent("PickerValueWasSet")); }, };