mirror of
https://github.com/schlagmichdoch/PairDrop.git
synced 2025-04-25 09:16:18 -04:00
Cleanup unused files
This commit is contained in:
parent
aa9e9497d6
commit
c962909c0e
33 changed files with 5 additions and 1206 deletions
|
@ -127,50 +127,39 @@
|
|||
return status;
|
||||
},
|
||||
attached: function() {
|
||||
// var adsDialog = document.querySelector('#ads');
|
||||
this.async(function() {
|
||||
app.conn.addEventListener('file-offered', function(e) {
|
||||
if (e.detail.to === this.contact.peerId) {
|
||||
this.status = 'Waiting to accept...';
|
||||
//adsDialog.open();
|
||||
}
|
||||
}.bind(this), false);
|
||||
app.conn.addEventListener('upload-started', function(e) {
|
||||
if (e.detail.to === this.contact.peerId) {
|
||||
this.status = 'Uploading...';
|
||||
// adsDialog.setState('Uploading...');
|
||||
}
|
||||
}.bind(this), false);
|
||||
app.conn.addEventListener('download-started', function(e) {
|
||||
if (e.detail.from === this.contact.peerId) {
|
||||
this.status = 'Downloading...';
|
||||
//adsDialog.open();
|
||||
// adsDialog.setState('Downloading...');
|
||||
}
|
||||
}.bind(this), false);
|
||||
app.conn.addEventListener('upload-complete', function(e) {
|
||||
if (e.detail.from === this.contact.peerId) {
|
||||
this.status = this.defaultStatus;
|
||||
adsDialog.setState('Transfer Complete');
|
||||
// adsDialog.close();
|
||||
}
|
||||
}.bind(this), false);
|
||||
app.conn.addEventListener('download-complete', function(e) {
|
||||
if (e.detail.from === this.contact.peerId) {
|
||||
this.status = this.defaultStatus;
|
||||
adsDialog.setState('Transfer Complete');
|
||||
// adsDialog.close();
|
||||
}
|
||||
}.bind(this), false);
|
||||
app.conn.addEventListener('file-declined', function(e) {
|
||||
if (e.detail.from === this.contact.peerId) {
|
||||
this.status = this.defaultStatus;
|
||||
// adsDialog.close(true);
|
||||
}
|
||||
}.bind(this), false);
|
||||
app.conn.addEventListener('upload-error', function(e) {
|
||||
this.status = this.defaultStatus;
|
||||
// adsDialog.close();
|
||||
}.bind(this), false);
|
||||
}, 200);
|
||||
}
|
||||
|
|
|
@ -167,7 +167,6 @@
|
|||
var peerId = e.model.item.peerId;
|
||||
var file = e.detail;
|
||||
app.conn.sendFile(peerId, file);
|
||||
//document.querySelector('#ads').open();
|
||||
},
|
||||
_computeShowExplanation: function(nBuddies) {
|
||||
if (!nBuddies || nBuddies === 0) {
|
||||
|
|
|
@ -3,9 +3,7 @@
|
|||
<link rel="import" href="../bower_components/paper-toast/paper-toast.html">
|
||||
<link rel="import" href="../bower_components/paper-progress/paper-progress.html">
|
||||
<link rel="import" href="../bower_components/neon-animation/neon-animated-pages.html">
|
||||
<!-- Configure your routes here
|
||||
<link rel="import" href="routing.html">
|
||||
-->
|
||||
|
||||
<!-- Add your elements here -->
|
||||
<link rel="import" href="../styles/app-theme.html">
|
||||
<link rel="import" href="x-cards/about-page.html">
|
||||
|
|
|
@ -8,7 +8,6 @@ Chat.FileSelectionBehavior = {
|
|||
return;
|
||||
}
|
||||
this._fileSelected(files[0]); //single select
|
||||
//files.forEach(this._fileSelected.bind(this)); //multi-select
|
||||
},
|
||||
_fileSelected: function(file) {
|
||||
if (file) {
|
||||
|
|
|
@ -982,234 +982,7 @@ BlobReadStream.prototype._emitReadChunk = function(){
|
|||
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
|
||||
|
||||
|
||||
function BlobWriteStream(options){
|
||||
|
||||
stream.Stream.call(this);
|
||||
|
||||
options = _.extend({
|
||||
onFull: onFull,
|
||||
onEnd: function(){},
|
||||
minBlockAllocSize: 0,
|
||||
drainDelay:0
|
||||
}, options);
|
||||
|
||||
this._onFull = options.onFull;
|
||||
this._onEnd = options.onEnd;
|
||||
this._onWrite = options.onWrite;
|
||||
|
||||
this._minBlockAllocSize = options.minBlockAllocSize;
|
||||
this._maxBlockAllocSize = options.maxBlockAllocSize;
|
||||
this._drainDelay = options.drainDelay;
|
||||
|
||||
this._buffer = new Buffer(options.minBlockAllocSize);
|
||||
this._destination = this._buffer;
|
||||
this._destinationPos = 0;
|
||||
|
||||
this._writeQueue = [];
|
||||
this._pendingOnFull = false;
|
||||
this._pendingQueueDrain = false;
|
||||
|
||||
this.writable = true;
|
||||
this.bytesWritten = 0;
|
||||
}
|
||||
|
||||
util.inherits(BlobWriteStream, stream.Stream);
|
||||
|
||||
BlobWriteStream.prototype.getBuffer = function(){
|
||||
return this._buffer;
|
||||
};
|
||||
|
||||
BlobWriteStream.prototype.write = function(data, encoding){
|
||||
|
||||
if(!this.writable){
|
||||
throw new Error("stream is not writable");
|
||||
}
|
||||
|
||||
if(!Buffer.isBuffer(data)){
|
||||
data = new Buffer(data, encoding);
|
||||
}
|
||||
|
||||
if(data.length){
|
||||
this._writeQueue.push(data);
|
||||
}
|
||||
|
||||
this._commit();
|
||||
|
||||
return this._writeQueue.length === 0;
|
||||
};
|
||||
|
||||
BlobWriteStream.prototype._commit = function(){
|
||||
|
||||
var self = this;
|
||||
|
||||
var destination = this._destination;
|
||||
var writeQueue = this._writeQueue;
|
||||
|
||||
var startDestinationPos = this._destinationPos;
|
||||
|
||||
while(writeQueue.length && destination.length){
|
||||
|
||||
var head = writeQueue[0];
|
||||
|
||||
var copySize = Math.min(destination.length, head.length);
|
||||
|
||||
head.copy(destination, 0, 0, copySize);
|
||||
|
||||
head = head.slice(copySize);
|
||||
destination = destination.slice(copySize);
|
||||
|
||||
this.bytesWritten += copySize;
|
||||
this._destinationPos += copySize;
|
||||
|
||||
if(head.length === 0){
|
||||
writeQueue.shift();
|
||||
}
|
||||
else{
|
||||
writeQueue[0] = head;
|
||||
}
|
||||
}
|
||||
|
||||
this._destination = destination;
|
||||
|
||||
bytesCommitted = this._destinationPos - startDestinationPos;
|
||||
if(bytesCommitted){
|
||||
if(this._onWrite){
|
||||
|
||||
if(writeQueue.length){
|
||||
this._pendingQueueDrain = true;
|
||||
}
|
||||
|
||||
// By locking destination the buffer is frozen and the onWrite
|
||||
// callback cannot miss any write commits
|
||||
this._destination = emptyBuffer;
|
||||
|
||||
var consumer = this._onWrite;
|
||||
this._onWrite = null;
|
||||
|
||||
consumer.call(this, function(nextCallback){
|
||||
util.setZeroTimeout(function(){
|
||||
self._destination = destination;
|
||||
self._onWrite = nextCallback;
|
||||
self._commit();
|
||||
});
|
||||
}, consumer);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if(writeQueue.length){
|
||||
|
||||
this._pendingQueueDrain = true;
|
||||
this._growBuffer();
|
||||
}
|
||||
else if(this._pendingQueueDrain){
|
||||
|
||||
this._pendingQueueDrain = false;
|
||||
|
||||
if(this._drainDelay !== 0){
|
||||
setTimeout(function(){
|
||||
self.emit("drain");
|
||||
}, this._drainDelay);
|
||||
}
|
||||
else{
|
||||
util.setZeroTimeout(function(){
|
||||
self.emit("drain");
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
BlobWriteStream.prototype._growBuffer = function(){
|
||||
|
||||
var self = this;
|
||||
var writeQueue = this._writeQueue;
|
||||
|
||||
var requestSize = this._minBlockAllocSize;
|
||||
|
||||
var maxBlockAllocSize = this._maxBlockAllocSize;
|
||||
var add = (maxBlockAllocSize === undefined ? function(a, b){return a + b;} : function(a, b){return Math.min(a + b, maxBlockAllocSize);});
|
||||
|
||||
for(var i = 0, queueLength = writeQueue.length; i < queueLength; i++){
|
||||
requestSize = add(requestSize, writeQueue[i].length);
|
||||
}
|
||||
|
||||
// Prevent concurrent onFull callbacks
|
||||
if(this._pendingOnFull){
|
||||
return;
|
||||
}
|
||||
this._pendingOnFull = true;
|
||||
|
||||
this._onFull(this._buffer, requestSize, function(buffer, destination){
|
||||
util.setZeroTimeout(function(){
|
||||
|
||||
self._pendingOnFull = false;
|
||||
|
||||
if(!destination){
|
||||
if(self.writable){
|
||||
self.emit("error", new Error("buffer is full"));
|
||||
}
|
||||
self.destroy();
|
||||
return;
|
||||
}
|
||||
|
||||
self._buffer = buffer;
|
||||
self._destination = destination;
|
||||
|
||||
self._commit();
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
BlobWriteStream.prototype.end = function(data, encoding){
|
||||
|
||||
var self = this;
|
||||
|
||||
function _end(){
|
||||
self.writable = false;
|
||||
self._onEnd();
|
||||
}
|
||||
|
||||
if(data){
|
||||
if(this.write(data, encoding)){
|
||||
_end();
|
||||
}else{
|
||||
self.writable = false;
|
||||
this.once("drain", _end);
|
||||
}
|
||||
}
|
||||
else{
|
||||
_end();
|
||||
}
|
||||
};
|
||||
|
||||
BlobWriteStream.prototype.destroy = function(){
|
||||
this.writable = false;
|
||||
this._pendingQueueDrain = false;
|
||||
this._writeQueue = [];
|
||||
};
|
||||
|
||||
BlobWriteStream.prototype.consume = function(consume){
|
||||
|
||||
this._buffer = this._buffer.slice(consume);
|
||||
this._destinationPos -= consume;
|
||||
};
|
||||
|
||||
BlobWriteStream.prototype.getCommittedSlice = function(){
|
||||
return this._buffer.slice(0, this._destinationPos);
|
||||
};
|
||||
|
||||
function onFull(buffer, extraSize, callback){
|
||||
var newBuffer = new Buffer(buffer.length + extraSize);
|
||||
buffer.copy(newBuffer);
|
||||
callback(newBuffer, newBuffer.slice(buffer.length));
|
||||
}
|
||||
*/
|
||||
exports.BlobReadStream = BlobReadStream;
|
||||
|
||||
function BinaryStream(socket, id, create, meta) {
|
||||
|
|
|
@ -109,7 +109,6 @@
|
|||
console.log(err);
|
||||
if (err.message.indexOf('Connection is not open') > -1) {
|
||||
console.error('Handle this error!!', err);
|
||||
//this.connectToPeer(requestedPeer, callback);
|
||||
}
|
||||
}.bind(this));
|
||||
|
||||
|
|
|
@ -33,7 +33,6 @@
|
|||
parts.push(data);
|
||||
}
|
||||
}.bind(this));
|
||||
// when finished, set it as the background image
|
||||
stream.on('end', function() {
|
||||
var blob = new Blob(parts, {
|
||||
type: meta.type
|
||||
|
|
|
@ -1,38 +0,0 @@
|
|||
<script src="../bower_components/page/page.js"></script>
|
||||
<script>
|
||||
window.addEventListener('WebComponentsReady', function() {
|
||||
|
||||
// We use Page.js for routing. This is a Micro
|
||||
// client-side router inspired by the Express router
|
||||
// More info: https://visionmedia.github.io/page.js/
|
||||
|
||||
// Removes end / from app.baseUrl which page.base requires for production
|
||||
if (window.location.port === '') { // if production
|
||||
page.base(app.baseUrl.replace(/\/$/, ''));
|
||||
}
|
||||
|
||||
|
||||
page('/', function() {
|
||||
app.route = 'home';
|
||||
});
|
||||
|
||||
page(app.baseUrl, function() {
|
||||
app.route = 'home';
|
||||
});
|
||||
|
||||
|
||||
|
||||
// 404
|
||||
page('*', function() {
|
||||
app.$.toast.text = 'Can\'t find: ' + window.location.href + '. Redirected you to Home Page';
|
||||
app.$.toast.show();
|
||||
page.redirect(app.baseUrl);
|
||||
});
|
||||
|
||||
// add #! before urls
|
||||
page({
|
||||
hashbang: true
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
|
@ -1,47 +0,0 @@
|
|||
<!doctype html>
|
||||
<!--
|
||||
@license
|
||||
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
Code distributed by Google as part of the polymer project is also
|
||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
|
||||
|
||||
<title>paper-dialog demo</title>
|
||||
|
||||
<script src="../../../bower_components/webcomponentsjs/webcomponents-lite.js"></script>
|
||||
|
||||
<link rel="import" href="../text-input-dialog.html">
|
||||
<link rel="import" href="../../../bower_components/paper-button/paper-button.html">
|
||||
<link rel="import" href="../../../bower_components/paper-dialog-scrollable/paper-dialog-scrollable.html">
|
||||
<link rel="import" href="../../../bower_components/paper-styles/color.html">
|
||||
<link rel="import" href="../../../bower_components/paper-styles/demo-pages.html">
|
||||
<link rel="import" href="../../../bower_components/neon-animation/neon-animations.html">
|
||||
<link rel="import" href="../../../bower_components/paper-dropdown-menu/paper-dropdown-menu.html">
|
||||
<link rel="import" href="../../../bower_components/paper-menu/paper-menu.html">
|
||||
<link rel="import" href="../../../bower_components/paper-item/paper-item.html">
|
||||
|
||||
<link rel="stylesheet" href="../../../paper-styles/demo.css">
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<text-input-dialog></text-input-dialog>
|
||||
|
||||
|
||||
<script>
|
||||
document.querySelector("text-input-dialog").open();
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -13,12 +13,6 @@
|
|||
background-color: #4285f4;
|
||||
@apply(--layout-fit);
|
||||
}
|
||||
/* paper-icon-button {
|
||||
position: absolute;
|
||||
top: 16px;
|
||||
right: 16px;
|
||||
z-index: 2;
|
||||
}*/
|
||||
|
||||
#container {
|
||||
@apply(--layout-fit);
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 33 KiB |
Binary file not shown.
Before Width: | Height: | Size: 33 KiB |
|
@ -95,20 +95,6 @@
|
|||
ga('create', 'UA-71686975-1', 'auto');
|
||||
ga('send', 'pageview');
|
||||
</script>
|
||||
<!-- <div id="ads">
|
||||
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
|
||||
<ins class="adsbygoogle" style="display:inline-block;width:320px;height:100px" data-ad-client="ca-pub-9914824802194583" data-ad-slot="1331757352"></ins>
|
||||
<script>
|
||||
(adsbygoogle = window.adsbygoogle || []).push({});
|
||||
</script>
|
||||
</div>
|
||||
<div id="ads2">
|
||||
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
|
||||
<ins class="adsbygoogle" style="display:inline-block;width:120px;height:600px" data-ad-client="ca-pub-9914824802194583" data-ad-slot="4027871759"></ins>
|
||||
<script>
|
||||
(adsbygoogle = window.adsbygoogle || []).push({});
|
||||
</script>
|
||||
</div> -->
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
|
@ -1,18 +1,11 @@
|
|||
(function(document) {
|
||||
'use strict';
|
||||
|
||||
// Grab a reference to our auto-binding template
|
||||
// and give it some initial binding values
|
||||
// Learn more about auto-binding templates at http://goo.gl/Dx1u2g
|
||||
var app = document.querySelector('#app');
|
||||
|
||||
// Sets app default base URL
|
||||
app.baseUrl = '/';
|
||||
if (window.location.port === '') { // if production
|
||||
// Uncomment app.baseURL below and
|
||||
// set app.baseURL to '/your-pathname/' if running from folder in production
|
||||
// app.baseUrl = '/polymer-starter-kit/';
|
||||
}
|
||||
|
||||
|
||||
// don't display the install prompt if the user has *already* installed
|
||||
window.addEventListener('beforeinstallprompt', function(event) {
|
||||
|
@ -48,9 +41,6 @@
|
|||
|
||||
});
|
||||
|
||||
app._showAbout=function(){
|
||||
document.querySelector('#pages').select(1);
|
||||
};
|
||||
app._showAbout=function(){
|
||||
document.querySelector('#pages').select(0);
|
||||
};
|
||||
|
|
|
@ -14,29 +14,3 @@ body {
|
|||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
#ads,
|
||||
#ads2 {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@media screen and (min-width: 520px) {
|
||||
#ads {
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 8px;
|
||||
left: 50%;
|
||||
margin-left: -150px;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (min-width: 720px) {
|
||||
#ads{
|
||||
display: none;
|
||||
}
|
||||
#ads2 {
|
||||
display: block;
|
||||
position: absolute;
|
||||
bottom: 4px;
|
||||
left: 4px;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1 @@
|
|||
/*
|
||||
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
Code distributed by Google as part of the polymer project is also
|
||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
*/
|
||||
|
||||
importScripts('bower_components/platinum-sw/service-worker.js');
|
||||
|
|
|
@ -1,32 +0,0 @@
|
|||
<!doctype html>
|
||||
<!--
|
||||
@license
|
||||
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
Code distributed by Google as part of the polymer project is also
|
||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
-->
|
||||
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
|
||||
<title>Elements Test Runner</title>
|
||||
<meta charset="UTF-8">
|
||||
|
||||
<script src="../bower_components/webcomponentsjs/webcomponents-lite.min.js"></script>
|
||||
<script src="../bower_components/web-component-tester/browser.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<script>
|
||||
WCT.loadSuites(['my-greeting-basic.html', 'my-list-basic.html']);
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -1,50 +0,0 @@
|
|||
<!doctype html>
|
||||
<!--
|
||||
@license
|
||||
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
Code distributed by Google as part of the polymer project is also
|
||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
-->
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
|
||||
<title>my-greeting-basic</title>
|
||||
|
||||
<script src="../bower_components/webcomponentsjs/webcomponents-lite.min.js"></script>
|
||||
<script src="../bower_components/web-component-tester/browser.js"></script>
|
||||
|
||||
<!-- Import the element to test -->
|
||||
<link rel="import" href="../elements/my-greeting/my-greeting.html">
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<test-fixture id="basic">
|
||||
<template>
|
||||
<my-greeting></my-greeting>
|
||||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<script>
|
||||
|
||||
suite('my-greeting tests', function() {
|
||||
var greeting, header;
|
||||
|
||||
setup(function() {
|
||||
greeting = fixture('basic');
|
||||
});
|
||||
|
||||
test('Welcome!', function() {
|
||||
header = greeting.querySelector('h2');
|
||||
assert.equal(header.textContent, 'Welcome!');
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -1,65 +0,0 @@
|
|||
<!doctype html>
|
||||
<!--
|
||||
@license
|
||||
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
Code distributed by Google as part of the polymer project is also
|
||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
-->
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
|
||||
<title>my-list-basic</title>
|
||||
|
||||
<script src="../bower_components/webcomponentsjs/webcomponents-lite.min.js"></script>
|
||||
<script src="../bower_components/web-component-tester/browser.js"></script>
|
||||
|
||||
<!-- Import the element to test -->
|
||||
<link rel="import" href="../elements/my-list/my-list.html">
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<test-fixture id="basic">
|
||||
<template>
|
||||
<my-list></my-list>
|
||||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<script>
|
||||
suite('my-list tests', function() {
|
||||
var list, listItems;
|
||||
|
||||
setup(function() {
|
||||
list = fixture('basic');
|
||||
});
|
||||
|
||||
test('Item lengths should be equalled', function(done) {
|
||||
// Test a property
|
||||
// TODO: Fix list.items.push('Foo') causing a WeakMap exception
|
||||
// Invalid value used as weak map key
|
||||
list.items = [
|
||||
'Responsive Web App boilerplate',
|
||||
'Iron Elements and Paper Elements',
|
||||
'End-to-end Build Tooling (including Vulcanize)',
|
||||
'Unit testing with Web Component Tester',
|
||||
'Routing with Page.js',
|
||||
'Offline support with the Platinum Service Worker Elements'
|
||||
];
|
||||
|
||||
// Data bindings will stamp out new DOM asynchronously
|
||||
// so wait to check for updates
|
||||
flush(function() {
|
||||
listItems = list.querySelectorAll('li');
|
||||
assert.equal(list.items.length, listItems.length);
|
||||
done();
|
||||
});
|
||||
})
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue