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

Side by Side Diff: tests/html/storage_quota_test.dart

Issue 658903005: Reapply "Stop suppressing generation of bindings with Promise. Add some tests for DOM APIs that ans… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/html/html.status ('k') | tools/dom/dom.json » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 library storage_quota_test;
2
3 import 'package:unittest/unittest.dart';
4 import 'package:unittest/html_config.dart';
5
6 import 'dart:async';
7 import 'dart:isolate';
8 import 'dart:html';
9
10 main() {
11 useHtmlConfiguration();
12
13 expectSaneStorageInfo(StorageInfo storageInfo) {
14 expect(storageInfo.usage, isNotNull);
15 expect(storageInfo.quota, isNotNull);
16 expect(storageInfo.usage >= 0, isTrue);
17 expect(storageInfo.quota >= storageInfo.usage, isNotNull);
18 };
19
20 test('storage quota - temporary', () {
21 Future f = window.navigator.storageQuota.queryInfo('temporary');
22 expect(f.then(expectSaneStorageInfo), completes);
23 });
24
25 test('storage quota - persistent', () {
26 Future f = window.navigator.storageQuota.queryInfo('persistent');
27 expect(f.then(expectSaneStorageInfo), completes);
28 });
29
30 test('storage quota - unknown', () {
31 // Throwing synchronously is bogus upstream behavior; should result in a
32 // smashed promise.
33 expect(() => window.navigator.storageQuota.queryInfo("foo"), throws); /// m issingenumcheck: ok
34 var wrongType = 3;
35 expect(() => window.navigator.storageQuota.queryInfo(wrongType), throws);
36 expect(() => window.navigator.storageQuota.queryInfo(null), throws);
37 });
38 }
OLDNEW
« no previous file with comments | « tests/html/html.status ('k') | tools/dom/dom.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698