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

Unified Diff: chrome/test/data/webui/md_history/lazy_render_test.js

Issue 2230003002: MD History: Add lazy-render element for simple lazy initialization. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Lazy render synced tabs menu Created 4 years, 4 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
Index: chrome/test/data/webui/md_history/lazy_render_test.js
diff --git a/chrome/test/data/webui/md_history/lazy_render_test.js b/chrome/test/data/webui/md_history/lazy_render_test.js
new file mode 100644
index 0000000000000000000000000000000000000000..4a988dbe650f800eb95ed3acefa747514a194b71
--- /dev/null
+++ b/chrome/test/data/webui/md_history/lazy_render_test.js
@@ -0,0 +1,35 @@
+// Copyright 2016 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('md_history.lazy_render_test', function() {
+ function registerTests() {
+ suite('history-lazy-render', function() {
+
+ setup(function() {
+ PolymerTest.clearBody();
+ var template = '<template is="history-lazy-render" id="lazy">' +
+ '<h1>Hello world!</h1>' +
+ '</template>';
+
+ document.body.innerHTML = template;
+ });
+
+ 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'));
+ });
+ });
+ });
calamity 2016/08/12 06:25:04 Any way to ensure path forwarding and notifying wo
tsergeant 2016/08/16 03:49:06 Done.
calamity 2016/08/16 07:00:01 Awesome!
+ }
+
+ return {
+ registerTests: registerTests,
+ }
+});

Powered by Google App Engine
This is Rietveld 408576698