diff options
author | nirnimesh@chromium.org <nirnimesh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-11 22:47:12 +0000 |
---|---|---|
committer | nirnimesh@chromium.org <nirnimesh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-11 22:47:12 +0000 |
commit | 5f89b6570b214565e89301b652b95175fdf5b1c2 (patch) | |
tree | 08e6c4840ca60b01a184b86a5dc12d364825c133 /chrome | |
parent | 996bdbda28035f7f68955525625c998290706281 (diff) | |
download | chromium_src-5f89b6570b214565e89301b652b95175fdf5b1c2.zip chromium_src-5f89b6570b214565e89301b652b95175fdf5b1c2.tar.gz chromium_src-5f89b6570b214565e89301b652b95175fdf5b1c2.tar.bz2 |
Add a pyauto test for chrome security on ChromeOS
BUG=
TEST=
Review URL: http://codereview.chromium.org/6826042
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81169 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-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() |