Commit 0248b7e5 authored by Esmael El-Moslimany's avatar Esmael El-Moslimany Committed by Commit Bot

Settings WebUI: password-export-dialog, fire close when closing dialogs

Bug: 903212
Change-Id: I2963b22bb55a0a3459331303887c6697e973489d
Reviewed-on: https://chromium-review.googlesource.com/c/1334830
Commit-Queue: Esmael El-Moslimany <aee@chromium.org>
Reviewed-by: default avatarDemetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#607900}
parent 84866d34
......@@ -54,7 +54,9 @@ Polymer({
showErrorDialog_: Boolean,
},
listeners: {'cancel': 'close'},
listeners: {
'cancel': 'close',
},
/**
* The interface for callbacks to the browser.
......@@ -169,6 +171,7 @@ Polymer({
this.showStartDialog_ = false;
this.showProgressDialog_ = false;
this.showErrorDialog_ = false;
this.fire('passwords-export-dialog-close');
},
/**
......
......@@ -138,7 +138,8 @@
</button>
</cr-action-menu>
<template is="dom-if" if="[[showPasswordsExportDialog_]]" restamp>
<passwords-export-dialog on-close="onPasswordsExportDialogClosed_">
<passwords-export-dialog
on-passwords-export-dialog-close="onPasswordsExportDialogClosed_">
</passwords-export-dialog>
</template>
<template is="dom-if" if="[[showPasswordEditDialog_]]" restamp>
......
......@@ -35,6 +35,7 @@ SettingsPasswordSectionBrowserTest.prototype = {
/** @override */
extraLibraries: PolymerTest.getLibraries(ROOT_PATH).concat([
'ensure_lazy_loaded.js',
'test_util.js',
]),
/** @override */
......@@ -918,6 +919,26 @@ TEST_F('SettingsPasswordSectionBrowserTest', 'uiTests', function() {
done();
});
test('fires close event when canceled', () => {
const exportDialog = createExportPasswordsDialog(passwordManager);
const wait = test_util.eventToPromise(
'passwords-export-dialog-close', exportDialog);
exportDialog.$$('#cancelButton').click();
return wait;
});
test('fires close event after export complete', () => {
const exportDialog = createExportPasswordsDialog(passwordManager);
const wait = test_util.eventToPromise(
'passwords-export-dialog-close', exportDialog);
exportDialog.$$('#exportPasswordsButton').click();
passwordManager.progressCallback(
{status: chrome.passwordsPrivate.ExportProgressStatus.IN_PROGRESS});
passwordManager.progressCallback(
{status: chrome.passwordsPrivate.ExportProgressStatus.SUCCEEDED});
return wait;
});
});
mocha.run();
......
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