diff options
Diffstat (limited to 'chrome/test/functional')
-rw-r--r-- | chrome/test/functional/PYAUTO_TESTS | 1 | ||||
-rw-r--r-- | chrome/test/functional/chromeos_security.py | 43 |
2 files changed, 44 insertions, 0 deletions
diff --git a/chrome/test/functional/PYAUTO_TESTS b/chrome/test/functional/PYAUTO_TESTS index 598918c..8ecd7dd8 100644 --- a/chrome/test/functional/PYAUTO_TESTS +++ b/chrome/test/functional/PYAUTO_TESTS @@ -175,6 +175,7 @@ 'chromeos': [ 'chromeos_basic', 'chromeos_power', + 'chromeos_security', 'chromeos_update', 'chromeos_wifi', '-chromeos_basic.ChromeosBasic.testScreenLocker', diff --git a/chrome/test/functional/chromeos_security.py b/chrome/test/functional/chromeos_security.py new file mode 100644 index 0000000..179b68a --- /dev/null +++ b/chrome/test/functional/chromeos_security.py @@ -0,0 +1,43 @@ +#!/usr/bin/python +# Copyright (c) 2011 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import os + +import pyauto_functional +import pyauto + + +class ChromeosSecurity(pyauto.PyUITest): + """Security tests for chrome on ChromeOS. + + Requires ChromeOS to be logged in. + """ + + def ExtraChromeFlagsOnChromeOS(self): + """Override default list of extra flags typicall used with automation. + + See the default flags used with automation in pyauto.py. + Chrome flags for this test should be as close to reality as possible. + """ + return [ + '--homepage=about:blank', + ] + + def testCannotViewLocalFiles(self): + """Verify that local files cannot be accessed from the browser.""" + urls_and_titles = { + 'file:///': 'Index of /', + 'file:///etc/': 'Index of /etc/', + self.GetFileURLForPath(os.path.join(self.DataDir(), 'title2.html')): + 'Title Of Awesomeness', + } + for url, title in urls_and_titles.iteritems(): + self.NavigateToURL(url) + self.assertNotEqual(title, self.GetActiveTabTitle(), + msg='Could access local file %s.' % url) + + +if __name__ == '__main__': + pyauto_functional.Main() |