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

Unified Diff: pkg/polymer/lib/elements/polymer-file/test/html/polymer-file.html

Issue 175443005: [polymer] import all elements (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: updated from bower Created 6 years, 10 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: pkg/polymer/lib/elements/polymer-file/test/html/polymer-file.html
diff --git a/pkg/polymer/lib/elements/polymer-file/test/html/polymer-file.html b/pkg/polymer/lib/elements/polymer-file/test/html/polymer-file.html
new file mode 100644
index 0000000000000000000000000000000000000000..39b6c7e49178d6bf1e965f4f15d1f041f2f24075
--- /dev/null
+++ b/pkg/polymer/lib/elements/polymer-file/test/html/polymer-file.html
@@ -0,0 +1,40 @@
+<!doctype html>
+<html>
+<head>
+ <title>polymer-file</title>
+ <script src="../../../platform/platform.js"></script>
+ <script src="../../../tools/test/htmltest.js"></script>
+ <script src="../../../tools/test/chai/chai.js"></script>
+ <link rel="import" href="../../polymer-file.html">
+</head>
+<body>
+
+ <polymer-file auto readas="text"></polymer-file>
+
+ <script>
+ var assert = chai.assert;
+ document.addEventListener('polymer-ready', 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>
« no previous file with comments | « pkg/polymer/lib/elements/polymer-file/polymer-file.html ('k') | pkg/polymer/lib/elements/polymer-file/test/js/polymer-file.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698