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

Side by Side Diff: chrome/test/functional/special_tabs.py

Issue 7455005: Apply content-security-policy to chrome://net-internals. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/webui/net_internals_ui.cc ('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 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 import logging 6 import logging
7 import os 7 import os
8 8
9 import pyauto_functional # Must be imported before pyauto 9 import pyauto_functional # Must be imported before pyauto
10 import pyauto 10 import pyauto
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 'chrome://dns': { 'title': 'About DNS' }, 53 'chrome://dns': { 'title': 'About DNS' },
54 'chrome://extensions': { 'title': 'Extensions' }, 54 'chrome://extensions': { 'title': 'Extensions' },
55 'chrome://flags': {}, 55 'chrome://flags': {},
56 'chrome://flash': {}, 56 'chrome://flash': {},
57 'chrome://gpu-internals': { 'CSP': False }, 57 'chrome://gpu-internals': { 'CSP': False },
58 'chrome://histograms': { 'title': 'About Histograms' }, 58 'chrome://histograms': { 'title': 'About Histograms' },
59 'chrome://history': { 'title': 'History' }, 59 'chrome://history': { 'title': 'History' },
60 'chrome://history2': { 'title': 'History', 'CSP': False }, 60 'chrome://history2': { 'title': 'History', 'CSP': False },
61 'chrome://media-internals': { 'title': 'Media Internals', 'CSP': False }, 61 'chrome://media-internals': { 'title': 'Media Internals', 'CSP': False },
62 'chrome://memory-redirect': { 'title': 'About Memory' }, 62 'chrome://memory-redirect': { 'title': 'About Memory' },
63 'chrome://net-internals': { 'CSP': False }, 63 'chrome://net-internals': {},
64 'chrome://net-internals/help.html': {},
64 'chrome://newtab': { 'title': 'New Tab', 'CSP': False }, 65 'chrome://newtab': { 'title': 'New Tab', 'CSP': False },
65 'chrome://plugins': { 'title': 'Plug-ins' }, 66 'chrome://plugins': { 'title': 'Plug-ins' },
66 'chrome://sessions': { 'title': 'Sessions', 'CSP': False }, 67 'chrome://sessions': { 'title': 'Sessions', 'CSP': False },
67 'chrome://settings': { 'title': 'Preferences - Basics' }, 68 'chrome://settings': { 'title': 'Preferences - Basics' },
68 'chrome://stats': { 'CSP': False }, 69 'chrome://stats': { 'CSP': False },
69 'chrome://sync': { 'title': 'Sync Internals', 'CSP': False }, 70 'chrome://sync': { 'title': 'Sync Internals', 'CSP': False },
70 'chrome://sync-internals': { 'title': 'Sync Internals', 'CSP': False }, 71 'chrome://sync-internals': { 'title': 'Sync Internals', 'CSP': False },
71 'chrome://terms': { 'CSP': False }, 72 'chrome://terms': { 'CSP': False },
72 'chrome://textfields': { 'title': 'chrome://textfields', 'CSP': False }, 73 'chrome://textfields': { 'title': 'chrome://textfields', 'CSP': False },
73 'chrome://version': { 'title': 'About Version' }, 74 'chrome://version': { 'title': 'About Version' },
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 logging.debug(' %s title was %s (%s)' % 280 logging.debug(' %s title was %s (%s)' %
280 (url, actual_title, expected_title == actual_title)) 281 (url, actual_title, expected_title == actual_title))
281 self.assertEqual(expected_title, actual_title) 282 self.assertEqual(expected_title, actual_title)
282 include_list = [] 283 include_list = []
283 exclude_list = [] 284 exclude_list = []
284 if 'CSP' in properties and not properties['CSP']: 285 if 'CSP' in properties and not properties['CSP']:
285 exclude_list.extend(['X-WebKit-CSP']) 286 exclude_list.extend(['X-WebKit-CSP'])
286 else: 287 else:
287 include_list.extend(['X-WebKit-CSP']) 288 include_list.extend(['X-WebKit-CSP'])
288 exclude_list.extend(['<script>', 'onclick=', 'onload=', 289 exclude_list.extend(['<script>', 'onclick=', 'onload=',
289 'onchange=', 'onsubmit=']) 290 'onchange=', 'onsubmit=', 'javascript:'])
290 if 'includes' in properties: 291 if 'includes' in properties:
291 include_list.extend(properties['includes']) 292 include_list.extend(properties['includes'])
292 if 'excludes' in properties: 293 if 'excludes' in properties:
293 exclude_list.extend(properties['exlcudes']) 294 exclude_list.extend(properties['exlcudes'])
294 test_utils.StringContentCheck(self, self.GetTabContents(), 295 test_utils.StringContentCheck(self, self.GetTabContents(),
295 include_list, exclude_list) 296 include_list, exclude_list)
296 297
297 def testAboutAppCacheTab(self): 298 def testAboutAppCacheTab(self):
298 """Test App Cache tab to confirm about page populates caches.""" 299 """Test App Cache tab to confirm about page populates caches."""
299 self.NavigateToURL('about:appcache-internals') 300 self.NavigateToURL('about:appcache-internals')
300 self._VerifyAppCacheInternals() 301 self._VerifyAppCacheInternals()
301 self.assertEqual('AppCache Internals', self.GetActiveTabTitle()) 302 self.assertEqual('AppCache Internals', self.GetActiveTabTitle())
302 303
303 def testAboutDNSTab(self): 304 def testAboutDNSTab(self):
304 """Test DNS tab to confirm DNS about page propogates records.""" 305 """Test DNS tab to confirm DNS about page propogates records."""
305 self.NavigateToURL('about:dns') 306 self.NavigateToURL('about:dns')
306 self._VerifyAboutDNS() 307 self._VerifyAboutDNS()
307 self.assertEqual('About DNS', self.GetActiveTabTitle()) 308 self.assertEqual('About DNS', self.GetActiveTabTitle())
308 309
309 def testSpecialAcceratorTabs(self): 310 def testSpecialAcceratorTabs(self):
310 """Test special tabs created by acclerators like IDC_SHOW_HISTORY, 311 """Test special tabs created by acclerators like IDC_SHOW_HISTORY,
311 IDC_SHOW_DOWNLOADS.""" 312 IDC_SHOW_DOWNLOADS."""
312 for accel, title in self.special_accelerator_tabs.iteritems(): 313 for accel, title in self.special_accelerator_tabs.iteritems():
313 self.RunCommand(accel) 314 self.RunCommand(accel)
314 self.assertEqual(title, self.GetActiveTabTitle()) 315 self.assertEqual(title, self.GetActiveTabTitle())
315 316
316 317
317 if __name__ == '__main__': 318 if __name__ == '__main__':
318 pyauto_functional.Main() 319 pyauto_functional.Main()
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/net_internals_ui.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698