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

Side by Side Diff: tools/android/loading/loading_model_unittest.py

Issue 1645953002: Conditional import of adblocker. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use new filters for ad filtering Created 4 years, 10 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
« no previous file with comments | « tools/android/loading/loading_model.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2015 The Chromium Authors. All rights reserved. 1 # Copyright 2015 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import os 5 import os
6 import sys 6 import sys
7 import unittest 7 import unittest
8 8
9 import dag 9 import dag
10 import loading_model 10 import loading_model
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 r.response_headers['Content-Type'] = 'image/gif' 183 r.response_headers['Content-Type'] = 'image/gif'
184 graph = self.MakeGraph(requests) 184 graph = self.MakeGraph(requests)
185 self.assertEqual(self.SuccessorIndicies(graph._nodes[0]), [1, 2, 3]) 185 self.assertEqual(self.SuccessorIndicies(graph._nodes[0]), [1, 2, 3])
186 self.assertEqual(self.SuccessorIndicies(graph._nodes[1]), []) 186 self.assertEqual(self.SuccessorIndicies(graph._nodes[1]), [])
187 self.assertEqual(self.SuccessorIndicies(graph._nodes[2]), [4, 5]) 187 self.assertEqual(self.SuccessorIndicies(graph._nodes[2]), [4, 5])
188 self.assertEqual(self.SuccessorIndicies(graph._nodes[3]), []) 188 self.assertEqual(self.SuccessorIndicies(graph._nodes[3]), [])
189 self.assertEqual(self.SuccessorIndicies(graph._nodes[4]), []) 189 self.assertEqual(self.SuccessorIndicies(graph._nodes[4]), [])
190 self.assertEqual(self.SuccessorIndicies(graph._nodes[5]), []) 190 self.assertEqual(self.SuccessorIndicies(graph._nodes[5]), [])
191 self.assertEqual(self.SortedIndicies(graph), [0, 1, 2, 3, 4, 5]) 191 self.assertEqual(self.SortedIndicies(graph), [0, 1, 2, 3, 4, 5])
192 192
193 def test_AdUrl(self):
194 self.assertTrue(loading_model.ResourceGraph._IsAdUrl(
195 'http://afae61024b33032ef.profile.sfo20.cloudfront.net/test.png'))
196 self.assertFalse(loading_model.ResourceGraph._IsAdUrl(
197 'http://afae61024b33032ef.profile.sfo20.cloudfront.net/tst.png'))
198
199 self.assertTrue(loading_model.ResourceGraph._IsAdUrl(
200 'http://ums.adtechus.com/mapuser?providerid=1003;'
201 'userid=RUmecco4z3o===='))
202 self.assertTrue(loading_model.ResourceGraph._IsAdUrl(
203 'http://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js'))
204
205 193
206 if __name__ == '__main__': 194 if __name__ == '__main__':
207 unittest.main() 195 unittest.main()
OLDNEW
« no previous file with comments | « tools/android/loading/loading_model.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698