This repository has been archived by the owner on Mar 13, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<title>polymer-file</title> | ||
<script src="../../../polymer/polymer.js"></script> | ||
<script src="../../../polymer/tools/test/htmltest.js"></script> | ||
<script src="../../node_modules/chai/chai.js"></script> | ||
<link rel="import" href="../../polymer-file/polymer-file.html"> | ||
</head> | ||
<body> | ||
|
||
<polymer-file auto readas="text"></polymer-file> | ||
|
||
<script> | ||
var assert = chai.assert; | ||
document.addEventListener('WebComponentsReady', function() { | ||
var DATA = 'abc123'; | ||
|
||
var pfile = document.querySelector('polymer-file'); | ||
|
||
assert.isNull(pfile.blob); | ||
assert.isTrue(pfile.auto); | ||
assert.equal(pfile.readas, 'text'); | ||
assert.isNull(pfile.result, ".auto doesn't start a read"); | ||
|
||
pfile.blob = new Blob([DATA], {type: 'text/plain'}); | ||
|
||
pfile.addEventListener('polymer-result', function(e) { | ||
assert.isDefined(e.detail.result); | ||
assert.isString(e.detail.result, 'Result is a text string'); | ||
assert.equal(e.detail.result, DATA, 'Result correct data'); | ||
assert.equal(pfile.result, DATA, '.result was set correctly'); | ||
|
||
done(); | ||
}); | ||
//pfile.read(); | ||
}); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/* | ||
* Copyright 2013 The Polymer Authors. All rights reserved. | ||
* Use of this source code is governed by a BSD-style | ||
* license that can be found in the LICENSE file. | ||
*/ | ||
|
||
htmlSuite('polymer-file', function() { | ||
htmlTest('html/polymer-file.html'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters