| Index: chrome/test/data/webui/cr_elements/cr_lazy_render_tests.js
|
| diff --git a/chrome/test/data/webui/cr_elements/cr_lazy_render_tests.js b/chrome/test/data/webui/cr_elements/cr_lazy_render_tests.js
|
| index 6be07ed12ffa29cc590c73e982eb0b7add24a707..a98ae28d6e8b69233cd0e957038016eac86a448f 100644
|
| --- a/chrome/test/data/webui/cr_elements/cr_lazy_render_tests.js
|
| +++ b/chrome/test/data/webui/cr_elements/cr_lazy_render_tests.js
|
| @@ -3,6 +3,8 @@
|
| // found in the LICENSE file.
|
|
|
| suite('cr-lazy-render', function() {
|
| + var lazy;
|
| + var bind;
|
|
|
| suiteSetup(function() {
|
| return PolymerTest.importHtml(
|
| @@ -21,44 +23,36 @@ suite('cr-lazy-render', function() {
|
| ' </template>' +
|
| '</template>';
|
| document.body.innerHTML = template;
|
| + lazy = document.getElementById('lazy');
|
| + bind = document.getElementById('bind');
|
| });
|
|
|
| test('stamps after get()', function() {
|
| - var lazy = document.getElementById('lazy');
|
| -
|
| assertFalse(!!document.body.querySelector('h1'));
|
| assertFalse(!!lazy.getIfExists());
|
|
|
| - return lazy.get().then(function(inner) {
|
| - assertEquals('H1', inner.nodeName);
|
| - assertEquals(inner, document.body.querySelector('h1'));
|
| - });
|
| + var inner = lazy.get();
|
| + assertEquals('H1', inner.nodeName);
|
| + assertEquals(inner, document.body.querySelector('h1'));
|
| });
|
|
|
| test('one-way binding works', function() {
|
| - var bind = document.getElementById('bind');
|
| bind.name = 'Wings';
|
| - var lazy = document.getElementById('lazy');
|
|
|
| - return lazy.get().then(function(inner) {
|
| - assertNotEquals(-1, inner.textContent.indexOf('Wings'));
|
| - bind.name = 'DC';
|
| - assertNotEquals(-1, inner.textContent.indexOf('DC'));
|
| - });
|
| + var inner = lazy.get();
|
| + assertNotEquals(-1, inner.textContent.indexOf('Wings'));
|
| + bind.name = 'DC';
|
| + assertNotEquals(-1, inner.textContent.indexOf('DC'));
|
| });
|
|
|
| test('two-way binding works', function() {
|
| - var bind = document.getElementById('bind');
|
| bind.checked = true;
|
|
|
| - var lazy = document.getElementById('lazy');
|
| -
|
| - return lazy.get().then(function(inner) {
|
| - var checkbox = document.querySelector('paper-checkbox');
|
| - assertTrue(checkbox.checked);
|
| - MockInteractions.tap(checkbox);
|
| - assertFalse(checkbox.checked);
|
| - assertFalse(bind.checked);
|
| - });
|
| + var inner = lazy.get();
|
| + var checkbox = document.querySelector('paper-checkbox');
|
| + assertTrue(checkbox.checked);
|
| + MockInteractions.tap(checkbox);
|
| + assertFalse(checkbox.checked);
|
| + assertFalse(bind.checked);
|
| });
|
| });
|
|
|