| OLD | NEW |
| (Empty) | |
| 1 <!doctype html> |
| 2 <!-- |
| 3 @license |
| 4 Copyright (c) 2015 The Polymer Project Authors. All rights reserved. |
| 5 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt |
| 6 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt |
| 7 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt |
| 8 Code distributed by Google as part of the polymer project is also |
| 9 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt |
| 10 --> |
| 11 <html> |
| 12 <head> |
| 13 <meta charset="UTF-8"> |
| 14 <title>iron-localstorage-raw</title> |
| 15 <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-
scale=1.0"> |
| 16 |
| 17 <script src="../../webcomponentsjs/webcomponents.js"></script> |
| 18 <script src="../../web-component-tester/browser.js"></script> |
| 19 <script src="../../test-fixture/test-fixture-mocha.js"></script> |
| 20 |
| 21 <link rel="import" href="../../test-fixture/test-fixture.html"> |
| 22 <link rel="import" href="../iron-localstorage.html"> |
| 23 |
| 24 </head> |
| 25 <body> |
| 26 |
| 27 |
| 28 <test-fixture id="fixture"> |
| 29 <template> |
| 30 <iron-localstorage id="localstorage" name="iron-localstorage-test" use-raw
></iron-localstorage> |
| 31 </template> |
| 32 </test-fixture> |
| 33 |
| 34 <script> |
| 35 |
| 36 var storage; |
| 37 |
| 38 suite('raw', function() { |
| 39 |
| 40 setup(function() { |
| 41 window.localStorage.setItem('iron-localstorage-test', 'hello world'); |
| 42 document.getElementById('fixture').create(); |
| 43 storage = document.getElementById('localstorage'); |
| 44 storage.flushDebouncer('reload'); |
| 45 }); |
| 46 |
| 47 teardown(function() { |
| 48 window.localStorage.removeItem('iron-localstorage-test'); |
| 49 }); |
| 50 |
| 51 test('load', function() { |
| 52 assert.equal(storage.value, 'hello world'); |
| 53 }); |
| 54 |
| 55 test('save', function() { |
| 56 var m = 'goodbye'; |
| 57 storage.value = m; |
| 58 storage.flushDebouncer('save'); |
| 59 var v = window.localStorage.getItem(storage.name); |
| 60 assert.equal(v, m); |
| 61 }); |
| 62 |
| 63 }); |
| 64 |
| 65 </script> |
| 66 |
| 67 </body> |
| 68 </html> |
| OLD | NEW |