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

Unified Diff: chrome/test/data/webui/polymer_browser_test_base.js

Issue 1333473002: Support lists in <cr-settings-pref> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@PrefsTests
Patch Set: Now with 100% more correctness Created 5 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/prefs/prefs.js ('k') | chrome/test/data/webui/settings/prefs_tests.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/webui/polymer_browser_test_base.js
diff --git a/chrome/test/data/webui/polymer_browser_test_base.js b/chrome/test/data/webui/polymer_browser_test_base.js
index 022c94012e31122db59e9f440b4095da6314f793..c4873770b3f0ddd59f253cf2ecdc07103f7b926f 100644
--- a/chrome/test/data/webui/polymer_browser_test_base.js
+++ b/chrome/test/data/webui/polymer_browser_test_base.js
@@ -102,20 +102,22 @@ PolymerTest.getLibraries = function(basePath) {
* Example: PolymerTest.async(fn1).async(fn2).async(fn3).async(done);
*/
PolymerTest.async = function(fn) {
- // Wrap the asynchronous call to |fn| in a Promise.
- var p = new Promise(function(resolve, reject) {
- setTimeout(function() {
- fn.call();
- resolve();
+ if (!PolymerTest.lastPromise_) {
+ PolymerTest.lastPromise_ = new Promise(function(resolve) {
+ setTimeout(fn);
+ setTimeout(resolve);
+ });
+ } else {
+ PolymerTest.lastPromise_ = PolymerTest.lastPromise_.then(function() {
+ return new Promise(function(resolve) {
+ fn();
+ setTimeout(resolve);
+ });
});
- });
+ }
// Return a helper function of the same name which adds this function to the
// Promise chain.
return {
- async: function(fn) {
- p.then(function() {
- return PolymerTest.async(fn);
- });
- },
+ async: PolymerTest.async
};
};
« no previous file with comments | « chrome/browser/resources/settings/prefs/prefs.js ('k') | chrome/test/data/webui/settings/prefs_tests.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698