mirror of
https://github.com/dart-lang/sdk
synced 2024-10-14 12:58:05 +00:00
de9ba250c5
Fix static warning in storage_quota_test. Fix status of fontface_loaded_test. R=leafp@google.com Review URL: https://codereview.chromium.org//658903005 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41210 260f80e4-7a28-3924-810f-c04153c831b5
39 lines
1.2 KiB
Dart
39 lines
1.2 KiB
Dart
library storage_quota_test;
|
|
|
|
import 'package:unittest/unittest.dart';
|
|
import 'package:unittest/html_config.dart';
|
|
|
|
import 'dart:async';
|
|
import 'dart:isolate';
|
|
import 'dart:html';
|
|
|
|
main() {
|
|
useHtmlConfiguration();
|
|
|
|
expectSaneStorageInfo(StorageInfo storageInfo) {
|
|
expect(storageInfo.usage, isNotNull);
|
|
expect(storageInfo.quota, isNotNull);
|
|
expect(storageInfo.usage >= 0, isTrue);
|
|
expect(storageInfo.quota >= storageInfo.usage, isNotNull);
|
|
};
|
|
|
|
test('storage quota - temporary', () {
|
|
Future f = window.navigator.storageQuota.queryInfo('temporary');
|
|
expect(f.then(expectSaneStorageInfo), completes);
|
|
});
|
|
|
|
test('storage quota - persistent', () {
|
|
Future f = window.navigator.storageQuota.queryInfo('persistent');
|
|
expect(f.then(expectSaneStorageInfo), completes);
|
|
});
|
|
|
|
test('storage quota - unknown', () {
|
|
// Throwing synchronously is bogus upstream behavior; should result in a
|
|
// smashed promise.
|
|
expect(() => window.navigator.storageQuota.queryInfo("foo"), throws); /// missingenumcheck: ok
|
|
var wrongType = 3;
|
|
expect(() => window.navigator.storageQuota.queryInfo(wrongType), throws);
|
|
expect(() => window.navigator.storageQuota.queryInfo(null), throws);
|
|
});
|
|
}
|