def testHTMLPreloadScannerWhitelisting(self):
   reference_url_set = set([self.GetResourceUrl('./'),
                            self.GetResourceUrl('0.png'),
                            self.GetResourceUrl('0.css')])
   url_set = sandwich_prefetch._ExtractDiscoverableUrls(None,
       self._TRACE_PATH, sandwich_prefetch.Discoverer.HTMLPreloadScanner)
   self.assertEquals(reference_url_set, url_set)
 def testFullCacheWhitelisting(self):
   reference_url_set = set([self.GetResourceUrl('./'),
                            self.GetResourceUrl('0.png'),
                            self.GetResourceUrl('1.png'),
                            self.GetResourceUrl('0.css'),
                            self.GetResourceUrl('favicon.ico')])
   url_set = sandwich_prefetch._ExtractDiscoverableUrls(None,
       self._TRACE_PATH, sandwich_prefetch.Discoverer.FullCache)
   self.assertEquals(reference_url_set, url_set)
 def testHTMLPreloadScannerWhitelisting(self):
     reference_url_set = set([
         self.GetResourceUrl('./'),
         self.GetResourceUrl('0.png'),
         self.GetResourceUrl('0.css')
     ])
     url_set = sandwich_prefetch._ExtractDiscoverableUrls(
         None, self._TRACE_PATH,
         sandwich_prefetch.Discoverer.HTMLPreloadScanner)
     self.assertEquals(reference_url_set, url_set)
 def testFullCacheWhitelisting(self):
     reference_url_set = set([
         self.GetResourceUrl('./'),
         self.GetResourceUrl('0.png'),
         self.GetResourceUrl('1.png'),
         self.GetResourceUrl('0.css'),
         self.GetResourceUrl('favicon.ico')
     ])
     url_set = sandwich_prefetch._ExtractDiscoverableUrls(
         None, self._TRACE_PATH, sandwich_prefetch.Discoverer.FullCache)
     self.assertEquals(reference_url_set, url_set)
 def RunTest(reference_urls):
     url_set = sandwich_prefetch._ExtractDiscoverableUrls(
         original_headers_path, self._TRACE_PATH,
         sandwich_prefetch.Discoverer.HTMLPreloadScannerStore)
     self.assertEquals(set(reference_urls), url_set)
 def testMainDocumentWhitelisting(self):
     reference_url_set = set([self.GetResourceUrl('./')])
     url_set = sandwich_prefetch._ExtractDiscoverableUrls(
         None, self._TRACE_PATH, sandwich_prefetch.Discoverer.MainDocument)
     self.assertEquals(reference_url_set, url_set)
 def testEmptyCacheWhitelisting(self):
     url_set = sandwich_prefetch._ExtractDiscoverableUrls(
         None, self._TRACE_PATH, sandwich_prefetch.Discoverer.EmptyCache)
     self.assertEquals(set(), url_set)
 def RunTest(reference_urls):
   url_set = sandwich_prefetch._ExtractDiscoverableUrls(
       original_headers_path, self._TRACE_PATH,
       sandwich_prefetch.Discoverer.HTMLPreloadScannerStore)
   self.assertEquals(set(reference_urls), url_set)
 def testMainDocumentWhitelisting(self):
   reference_url_set = set([self.GetResourceUrl('./')])
   url_set = sandwich_prefetch._ExtractDiscoverableUrls(None,
       self._TRACE_PATH, sandwich_prefetch.Discoverer.MainDocument)
   self.assertEquals(reference_url_set, url_set)
 def testEmptyCacheWhitelisting(self):
   url_set = sandwich_prefetch._ExtractDiscoverableUrls(None,
       self._TRACE_PATH, sandwich_prefetch.Discoverer.EmptyCache)
   self.assertEquals(set(), url_set)