Index: chrome/test/data/webui/settings/ensure_lazy_loaded.js |
diff --git a/chrome/test/data/webui/settings/ensure_lazy_loaded.js b/chrome/test/data/webui/settings/ensure_lazy_loaded.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..7ec8a43cba894812ef06f52bc9470de5d9eddd85 |
--- /dev/null |
+++ b/chrome/test/data/webui/settings/ensure_lazy_loaded.js |
@@ -0,0 +1,22 @@ |
+// Copyright 2017 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+cr.define('settings', function() { |
+ function ensureLazyLoaded() { |
+ // Only trigger lazy loading, if we are in top-level Settings page. |
+ if (location.href == location.origin + '/') { |
+ suiteSetup(function() { |
+ return new Promise(function(resolve, reject) { |
+ // This URL needs to match the URL passed to <settings-idle-load> from |
+ // <settings-basic-page>. |
+ Polymer.Base.importHref('/lazy_load.html', resolve, reject, true); |
+ }); |
+ }); |
+ } |
+ } |
+ |
+ return { |
+ ensureLazyLoaded: ensureLazyLoaded, |
+ }; |
+}); |