test: use contentLength helper
diff --git a/test/alternative_root_test.dart b/test/alternative_root_test.dart
index 091de1a..a7ba8a3 100644
--- a/test/alternative_root_test.dart
+++ b/test/alternative_root_test.dart
@@ -36,7 +36,7 @@
       return makeRequest(handler, '/static/root.txt', scriptName: '/static')
           .then((response) {
         expect(response.statusCode, HttpStatus.OK);
-        expect(response.headers[HttpHeaders.CONTENT_LENGTH], '8');
+        expect(response.contentLength, 8);
         expect(response.readAsString(), completion('root txt'));
       });
     });
@@ -49,7 +49,7 @@
       return makeRequest(handler, '/static/files/with%20space.txt',
           scriptName: '/static').then((response) {
         expect(response.statusCode, HttpStatus.OK);
-        expect(response.headers[HttpHeaders.CONTENT_LENGTH], '18');
+        expect(response.contentLength, 18);
         expect(response.readAsString(), completion('with space content'));
       });
     });
@@ -73,7 +73,7 @@
       return makeRequest(handler, '/static/files/test.txt',
           scriptName: '/static').then((response) {
         expect(response.statusCode, HttpStatus.OK);
-        expect(response.headers[HttpHeaders.CONTENT_LENGTH], '16');
+        expect(response.contentLength, 16);
         expect(response.readAsString(), completion('test txt content'));
       });
     });
diff --git a/test/basic_file_test.dart b/test/basic_file_test.dart
index 59e0efa..7d8c953 100644
--- a/test/basic_file_test.dart
+++ b/test/basic_file_test.dart
@@ -39,7 +39,7 @@
 
       return makeRequest(handler, '/root.txt').then((response) {
         expect(response.statusCode, HttpStatus.OK);
-        expect(response.headers[HttpHeaders.CONTENT_LENGTH], '8');
+        expect(response.contentLength, 8);
         expect(response.readAsString(), completion('root txt'));
       });
     });
@@ -51,7 +51,7 @@
 
       return makeRequest(handler, '/files/with%20space.txt').then((response) {
         expect(response.statusCode, HttpStatus.OK);
-        expect(response.headers[HttpHeaders.CONTENT_LENGTH], '18');
+        expect(response.contentLength, 18);
         expect(response.readAsString(), completion('with space content'));
       });
     });
@@ -73,7 +73,7 @@
 
       return makeRequest(handler, '/files/test.txt').then((response) {
         expect(response.statusCode, HttpStatus.OK);
-        expect(response.headers[HttpHeaders.CONTENT_LENGTH], '16');
+        expect(response.contentLength, 16);
         expect(response.readAsString(), completion('test txt content'));
       });
     });