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

Unified Diff: test/iron_localstorage_basic_test.dart

Issue 1418513006: update elements and fix some bugs (Closed) Base URL: git@github.com:dart-lang/polymer_elements.git@master
Patch Set: code review updates Created 5 years, 2 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
« no previous file with comments | « test/iron_list_test_helpers.dart ('k') | test/iron_media_query_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/iron_localstorage_basic_test.dart
diff --git a/test/iron_localstorage_basic_test.dart b/test/iron_localstorage_basic_test.dart
index 0acd6044a5e7bcafa3379ee78ecad9bdba7eefe2..16ebce2f86bdb5a7e170cea8eb624d39f6cee207 100644
--- a/test/iron_localstorage_basic_test.dart
+++ b/test/iron_localstorage_basic_test.dart
@@ -8,13 +8,14 @@ import 'dart:async';
import 'dart:convert';
import 'dart:html';
import 'dart:js';
+import 'package:polymer/polymer.dart';
import 'package:polymer_elements/iron_localstorage.dart';
import 'package:test/test.dart';
import 'package:web_components/web_components.dart';
import 'common.dart';
main() async {
- await initWebComponents();
+ await initPolymer();
IronLocalstorage storage;
group('basic', () {
@@ -36,7 +37,7 @@ main() async {
test('save', () {
var newValue = {'foo': 'zot'};
storage.value = newValue;
- storage.jsElement.callMethod('flushDebouncer', ['save']);
+ storage.flushDebouncer('save');
var v = window.localStorage[storage.name];
v = JSON.decode(v);
expect(v['foo'], newValue['foo']);
@@ -44,7 +45,7 @@ main() async {
test('delete', () {
storage.value = null;
- storage.jsElement.callMethod('flushDebouncer', ['save']);
+ storage.flushDebouncer('save');
var v = window.localStorage[storage.name];
expect(v, isNull);
});
@@ -66,7 +67,7 @@ main() async {
ls.on['iron-localstorage-load-empty'].take(1).listen((_) {
// testing recommended way to initialize localstorage
ls.value = "Yo";
- ls.jsElement.callMethod('flushDebouncer', ['save']);
+ ls.flushDebouncer('save');
expect(
"Yo", JSON.decode(window.localStorage['iron-localstorage-test']));
done.complete();
@@ -76,21 +77,20 @@ main() async {
});
test('auto-save sub-properties', () {
- var t = new JsObject.fromBrowserObject(
- document.querySelector('#boundTemplate'));
+ DomBind t = document.querySelector('#boundTemplate');
var ls = document.querySelector('#boundLocal') as IronLocalstorage;
var value = new JsObject.jsify({'foo': 'FOO', 'bar': 'BAR'});
t['value'] = value;
expect('FOO',
ls.value['foo']); // value has propagated from template to storage
- ls.jsElement.callMethod('flushDebouncer', ['save']);
+ ls.flushDebouncer('save');
t['value']['foo'] = "Yo";
- ls.jsElement.callMethod('flushDebouncer', ['save']);
+ ls.flushDebouncer('save');
var item = JSON.decode(window.localStorage['iron-localstorage-test']);
expect('Yo',
isNot(item['foo'])); // did not propagate because did not use setters
- t.callMethod('set', ['value.foo', 'BAZ!']);
- ls.jsElement.callMethod('flushDebouncer', ['save']);
+ t.set('value.foo', 'BAZ!');
+ ls.flushDebouncer('save');
item = JSON.decode(window.localStorage['iron-localstorage-test']);
expect('BAZ!', item['foo']); // did propagate
ls.value = null;
« no previous file with comments | « test/iron_list_test_helpers.dart ('k') | test/iron_media_query_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698