From 28d4337f9adc7727bb20650cd18856f9c5677648 Mon Sep 17 00:00:00 2001 From: "Scott J. Miles" Date: Mon, 3 Nov 2014 11:17:27 -0800 Subject: [PATCH] normalize sampler and spa project structures --- perf-lib/perf.js | 12 ++++++++++++ .../sampler/{app-xplat.html => app-chrome.html} | 14 ++++++-------- projects/sampler/app-wc-lite.html | 8 ++------ projects/sampler/app.html | 16 +++++++++------- projects/sampler/{ => src}/x-app.html | 7 ++++--- projects/spa/app.html | 4 +--- 6 files changed, 34 insertions(+), 27 deletions(-) rename projects/sampler/{app-xplat.html => app-chrome.html} (60%) rename projects/sampler/{ => src}/x-app.html (91%) diff --git a/perf-lib/perf.js b/perf-lib/perf.js index 90b3a72c..7a237975 100644 --- a/perf-lib/perf.js +++ b/perf-lib/perf.js @@ -14,6 +14,18 @@ console.perf = function() { }; console.perfEnd = function() { + if (window.WebComponents) { + // TODO(sjmiles): we need some kind of 'whenReady' or other signal + // that will work if this function is called after the event has fired + addEventListener('WebComponentsReady', function() { + console._perfEnd(); + }); + } else { + console._perfEnd(); + } +}; + +console._perfEnd = function() { // force layout document.body.offsetWidth; var time = performance.now() - console.perf.time; diff --git a/projects/sampler/app-xplat.html b/projects/sampler/app-chrome.html similarity index 60% rename from projects/sampler/app-xplat.html rename to projects/sampler/app-chrome.html index ea81135c..ebad3fdf 100644 --- a/projects/sampler/app-xplat.html +++ b/projects/sampler/app-chrome.html @@ -2,19 +2,17 @@ - - - - + + Sampler - - - - + + + +