Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2927)

Unified Diff: chrome/test/data/webui/settings/reset_page_test.js

Issue 2339853003: MD Settings: Fix Reset profile dialog scenario that causes a crash. (Closed)
Patch Set: Nit Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/settings/settings_resources.grd ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/webui/settings/reset_page_test.js
diff --git a/chrome/test/data/webui/settings/reset_page_test.js b/chrome/test/data/webui/settings/reset_page_test.js
index ee4172f8f4004f3951de5c2e678471b1b23d22bb..964c26bb6ce25cd5c870acd1fc723eb4f6dc90b0 100644
--- a/chrome/test/data/webui/settings/reset_page_test.js
+++ b/chrome/test/data/webui/settings/reset_page_test.js
@@ -95,7 +95,7 @@ cr.define('settings_reset_page', function() {
dialog = resetBanner.$$('settings-reset-profile-dialog');
assertTrue(!!dialog);
- dialog.dispatchEvent(new CustomEvent('reset-done'));
+ dialog.fire('reset-done');
Polymer.dom.flush();
assertEquals('none', dialog.style.display);
return Promise.resolve();
@@ -149,9 +149,9 @@ cr.define('settings_reset_page', function() {
// Open reset profile dialog.
MockInteractions.tap(resetPage.$.resetProfile);
+ Polymer.dom.flush();
var dialog = resetPage.$$('settings-reset-profile-dialog');
assertTrue(!!dialog);
- assertTrue(dialog.$.dialog.open);
var onDialogClosed = new Promise(
function(resolve, reject) {
dialog.addEventListener('close', function() {
@@ -162,6 +162,7 @@ cr.define('settings_reset_page', function() {
return resetPageBrowserProxy.whenCalled(
'onShowResetProfileDialog').then(function() {
+ assertTrue(dialog.$.dialog.open);
closeDialogFn(dialog);
return Promise.all([
onDialogClosed,
@@ -189,6 +190,7 @@ cr.define('settings_reset_page', function() {
test(TestNames.ResetProfileDialogAction, function() {
// Open reset profile dialog.
MockInteractions.tap(resetPage.$.resetProfile);
+ Polymer.dom.flush();
var dialog = resetPage.$$('settings-reset-profile-dialog');
assertTrue(!!dialog);
@@ -202,6 +204,7 @@ cr.define('settings_reset_page', function() {
assertFalse(dialog.$.resetSpinner.active);
MockInteractions.tap(dialog.$.reset);
assertTrue(dialog.$.reset.disabled);
+ assertTrue(dialog.$.cancel.disabled);
assertTrue(dialog.$.resetSpinner.active);
return resetPageBrowserProxy.whenCalled(
'performResetProfileSettings');
@@ -218,6 +221,7 @@ cr.define('settings_reset_page', function() {
function testOpenClosePowerwashDialog(closeButtonFn) {
// Open powerwash dialog.
MockInteractions.tap(resetPage.$.powerwash);
+ Polymer.dom.flush();
var dialog = resetPage.$$('settings-powerwash-dialog');
assertTrue(!!dialog);
assertTrue(dialog.$.dialog.open);
@@ -239,14 +243,15 @@ cr.define('settings_reset_page', function() {
// Tests that the powerwash dialog opens and closes correctly, and
// that chrome.send calls are propagated as expected.
test(TestNames.PowerwashDialogOpenClose, function() {
- return Promise.all([
- // Test case where the 'cancel' button is clicked.
- testOpenClosePowerwashDialog(
- function(dialog) { return dialog.$.cancel; }),
+ // Test case where the 'cancel' button is clicked.
+ return testOpenClosePowerwashDialog(function(dialog) {
+ return dialog.$.cancel;
+ }).then(function() {
// Test case where the 'close' button is clicked.
- testOpenClosePowerwashDialog(
- function(dialog) { return dialog.$.dialog.getCloseButton(); }),
- ]);
+ return testOpenClosePowerwashDialog(function(dialog) {
+ return dialog.$.dialog.getCloseButton();
+ });
+ });
});
// Tests that when powerwash is requested chrome.send calls are
@@ -254,6 +259,7 @@ cr.define('settings_reset_page', function() {
test(TestNames.PowerwashDialogAction, function() {
// Open powerwash dialog.
MockInteractions.tap(resetPage.$.powerwash);
+ Polymer.dom.flush();
var dialog = resetPage.$$('settings-powerwash-dialog');
assertTrue(!!dialog);
MockInteractions.tap(dialog.$.powerwash);
« no previous file with comments | « chrome/browser/resources/settings/settings_resources.grd ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698