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

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

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

Powered by Google App Engine
This is Rietveld 408576698