-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Settings: add optional send feedback button to section headers
Adds a send feedback button to settings-section, which can be enabled by adding a `send-feedback` attribute and a `on-send-feedback` event handler. This is a precursor to moving the performance settings page's send feedback entrypoint outside of the toggle button sub-labels. Bug: 1377051 Change-Id: I33c276308747a0913bbe10ba2cc739e4008e467b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4218648 Commit-Queue: Charles Meng <charlesmeng@chromium.org> Reviewed-by: John Lee <johntlee@chromium.org> Reviewed-by: Eshwar Stalin <estalin@chromium.org> Cr-Commit-Position: refs/heads/main@{#1103057}
- Loading branch information
Charles Meng
authored and
Chromium LUCI CQ
committed
Feb 9, 2023
1 parent
5dd74fd
commit 9a9f40e
Showing
9 changed files
with
80 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
chrome/app/settings_strings_grdp/IDS_SETTINGS_SEND_FEEDBACK_ROLE_DESCRIPTION.png.sha1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
457a51ac48111392f5eb18abfd590ea74e23f55e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Copyright 2023 The Chromium Authors | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
import 'chrome://settings/settings.js'; | ||
|
||
import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; | ||
import {CrIconButtonElement} from 'chrome://settings/lazy_load.js'; | ||
import {SettingsSectionElement} from 'chrome://settings/settings.js'; | ||
import {assertFalse, assertTrue} from 'chrome://webui-test/chai_assert.js'; | ||
import {eventToPromise} from 'chrome://webui-test/test_util.js'; | ||
|
||
suite('SettingsSection', function() { | ||
let settingsSection: SettingsSectionElement; | ||
|
||
setup(function() { | ||
document.body.innerHTML = window.trustedTypes!.emptyHTML; | ||
settingsSection = document.createElement('settings-section'); | ||
document.body.appendChild(settingsSection); | ||
flush(); | ||
}); | ||
|
||
test('Send feedback bubble', async function() { | ||
let feedback: CrIconButtonElement|null = | ||
settingsSection.shadowRoot!.querySelector('#feedback'); | ||
assertFalse(!!feedback); | ||
|
||
settingsSection.showSendFeedbackButton = true; | ||
const feedbackClicked = eventToPromise('send-feedback', settingsSection); | ||
flush(); | ||
|
||
feedback = settingsSection.shadowRoot!.querySelector('#feedback'); | ||
assertTrue(!!feedback); | ||
feedback.click(); | ||
await feedbackClicked; | ||
}); | ||
}); |