Chromium Code Reviews| 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 964c26bb6ce25cd5c870acd1fc723eb4f6dc90b0..98edfbd688580baf3a2e8048a5f2ec72e215248c 100644 |
| --- a/chrome/test/data/webui/settings/reset_page_test.js |
| +++ b/chrome/test/data/webui/settings/reset_page_test.js |
| @@ -86,19 +86,25 @@ cr.define('settings_reset_page', function() { |
| // Tests that the reset profile banner |
| // - opens the reset profile dialog when the reset button is clicked. |
| + // - reset happens when clicking on the dialog's reset button. |
| // - the reset profile dialog is closed after reset is done. |
| test(TestNames.ResetBannerReset, function() { |
| var dialog = resetBanner.$$('settings-reset-profile-dialog'); |
| assertFalse(!!dialog); |
| MockInteractions.tap(resetBanner.$['reset']); |
| Polymer.dom.flush(); |
| + assertTrue(resetBanner.showResetProfileDialog_) |
| dialog = resetBanner.$$('settings-reset-profile-dialog'); |
| assertTrue(!!dialog); |
| - dialog.fire('reset-done'); |
| - Polymer.dom.flush(); |
| - assertEquals('none', dialog.style.display); |
| - return Promise.resolve(); |
| + MockInteractions.tap(dialog.$['reset']); |
|
tommycli
2016/10/03 20:47:46
nit: the dialog.$['foo'] pattern seems odd. Any re
alito
2016/10/03 23:27:17
No particular reason. I was just following the sam
|
| + flush().then(function() { |
|
tommycli
2016/10/03 20:47:46
I wonder if this the then() may be skipped in some
alito
2016/10/03 23:27:17
I think your suggestion seems safer so I've change
|
| + assertFalse(resetBanner.showResetProfileDialog_); |
| + dialog = resetBanner.$$('settings-reset-profile-dialog'); |
| + assertFalse(!!dialog); |
| + }); |
| + |
| + return browserProxy.whenCalled('performResetProfileSettings'); |
| }); |
| // Tests that the reset profile banner removes itself from the DOM when |
| @@ -178,9 +184,11 @@ cr.define('settings_reset_page', function() { |
| // Test case where the 'cancel' button is clicked. |
| MockInteractions.tap(dialog.$.cancel); |
| }).then(function() { |
| - return testOpenCloseResetProfileDialog(function(dialog) { |
| - // Test case where the 'close' button is clicked. |
| - MockInteractions.tap(dialog.$.dialog.getCloseButton()); |
| + return flush().then(function() { |
|
tommycli
2016/10/03 20:47:46
nit: i think we can linearize the promise chain li
alito
2016/10/03 23:27:17
Done.
|
| + return testOpenCloseResetProfileDialog(function(dialog) { |
| + // Test case where the 'close' button is clicked. |
| + MockInteractions.tap(dialog.$.dialog.getCloseButton()); |
| + }); |
| }); |
| }); |
| }); |