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

Side by Side Diff: test/codegen/lib/html/cache_test.dart

Issue 1930043002: Add all dart:html tests from the sdk to test/codegen. (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 7 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
OLDNEW
(Empty)
1 library CacheTest;
2 import 'package:unittest/unittest.dart';
3 import 'package:unittest/html_individual_config.dart';
4 import 'dart:html';
5
6 main() {
7 useHtmlIndividualConfiguration();
8
9 group('supported', () {
10 test('supported', () {
11 expect(ApplicationCache.supported, true);
12 });
13 });
14
15 group('ApplicationCache', () {
16 test('ApplicationCache', () {
17 var expectation = ApplicationCache.supported ? returnsNormally : throws;
18 expect(() {
19 ApplicationCache appCache = window.applicationCache;
20 expect(cacheStatusToString(appCache.status), "UNCACHED");
21 }, expectation);
22
23 });
24 });
25
26 }
27
28 String cacheStatusToString(int status) {
29 switch (status) {
30 case ApplicationCache.UNCACHED: // UNCACHED == 0
31 return 'UNCACHED';
32 case ApplicationCache.IDLE: // IDLE == 1
33 return 'IDLE';
34 case ApplicationCache.CHECKING: // CHECKING == 2
35 return 'CHECKING';
36 case ApplicationCache.DOWNLOADING: // DOWNLOADING == 3
37 return 'DOWNLOADING';
38 case ApplicationCache.UPDATEREADY: // UPDATEREADY == 4
39 return 'UPDATEREADY';
40 case ApplicationCache.OBSOLETE: // OBSOLETE == 5
41 return 'OBSOLETE';
42 default:
43 return 'UNKNOWN CACHE STATUS';
44 };
45 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698