Chromium Code Reviews| 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..f2bae8c03ed6ff965b0be66893ac91a5b00bf342 |
| --- /dev/null |
| +++ b/chrome/test/data/webui/settings/ensure_lazy_loaded.js |
| @@ -0,0 +1,21 @@ |
| +// 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() { |
| + |
|
Dan Beam
2017/03/17 00:31:43
nit: no \n
dpapad
2017/03/17 20:53:55
Done.
|
| + function ensureLazyLoaded() { |
| + // Only trigger lazy loading, if we are in top-level Settings page. |
| + if (window.location.href == 'chrome://md-settings/') { |
|
Dan Beam
2017/03/17 00:31:43
nit: if (location.href == location.origin) {
gets
dpapad
2017/03/17 20:53:55
Done.
|
| + suiteSetup(function() { |
| + return new Promise(function(resolve, reject) { |
|
Dan Beam
2017/03/17 00:31:43
nit: mention this needs to be basically exactly th
dpapad
2017/03/17 20:53:55
Done.
|
| + Polymer.Base.importHref('/lazy_load.html', resolve, reject, true); |
| + }); |
| + }); |
| + } |
| + } |
| + |
| + return { |
| + ensureLazyLoaded: ensureLazyLoaded, |
| + }; |
| +}); |