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

Unified Diff: tools/android/loading/request_track_unittest.py

Issue 1610273002: Upgrade loading_model to use the new request_track and loading_trace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/android/loading/request_track.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/android/loading/request_track_unittest.py
diff --git a/tools/android/loading/request_track_unittest.py b/tools/android/loading/request_track_unittest.py
index ac08b30504e3265c1cc577bae20f2b06f444554f..97ea57fd32e6db3258ba077d8e4f96ef6973b70d 100644
--- a/tools/android/loading/request_track_unittest.py
+++ b/tools/android/loading/request_track_unittest.py
@@ -268,6 +268,21 @@ class RequestTrackTestCase(unittest.TestCase):
request_track = RequestTrack.FromJsonDict(json_dict)
self.assertEquals(self.request_track, request_track)
+ def testMaxAge(self):
+ rq = Request()
+ self.assertEqual(-1, rq.MaxAge())
+ rq.response_headers = {}
+ self.assertEqual(-1, rq.MaxAge())
+ rq.response_headers[
+ 'Cache-Control'] = 'private,s-maxage=0,max-age=0,must-revalidate'
+ self.assertEqual(0, rq.MaxAge())
+ rq.response_headers[
+ 'Cache-Control'] = 'private,s-maxage=0,no-store,max-age=100'
+ self.assertEqual(-1, rq.MaxAge())
+ rq.response_headers[
+ 'Cache-Control'] = 'private,s-maxage=0'
+ self.assertEqual(-1, rq.MaxAge())
+
@classmethod
def _ValidSequence(cls, request_track):
request_track.Handle(
« no previous file with comments | « tools/android/loading/request_track.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698