diff options
author | nirnimesh@chromium.org <nirnimesh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-10 22:37:38 +0000 |
---|---|---|
committer | nirnimesh@chromium.org <nirnimesh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-10 22:37:38 +0000 |
commit | f89e9a5f975a31b94722910370863aa448cc6a11 (patch) | |
tree | c580a4e5f9822f6b75f8eae76a4427510c119e5d | |
parent | 336afa197d76ba71ae349ff9ee389577edfa8a7c (diff) | |
download | chromium_src-f89e9a5f975a31b94722910370863aa448cc6a11.zip chromium_src-f89e9a5f975a31b94722910370863aa448cc6a11.tar.gz chromium_src-f89e9a5f975a31b94722910370863aa448cc6a11.tar.bz2 |
Verify enabeling and disable javascript prefs works
( Note: Data file related to the same test is submitted in a different CL)
Verify prefs to enabled/disables omnibox suggestions
Review URL: http://codereview.chromium.org/5556010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68896 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/test/data/javaScriptTitle.html | 12 | ||||
-rw-r--r-- | chrome/test/functional/prefs.py | 14 |
2 files changed, 26 insertions, 0 deletions
diff --git a/chrome/test/data/javaScriptTitle.html b/chrome/test/data/javaScriptTitle.html new file mode 100644 index 0000000..31d1560 --- /dev/null +++ b/chrome/test/data/javaScriptTitle.html @@ -0,0 +1,12 @@ +<html> +<head> +<script language="JavaScript"> +function message() +{ + document.title = "Title from script javascript enabled"; +} +</script> +<title>This is html title</title></head> + +<body onload="message()"></body> +</html> diff --git a/chrome/test/functional/prefs.py b/chrome/test/functional/prefs.py index 2cf9edc..d27db89 100644 --- a/chrome/test/functional/prefs.py +++ b/chrome/test/functional/prefs.py @@ -174,6 +174,20 @@ class PrefsTest(pyauto.PyUITest): for pref in pref_list: self.assertEqual(self.GetPrefsInfo().Prefs(pref), False) + def testJavaScriptEnableDisable(self): + """Verify enabling disabling javascript prefs work """ + + self.assertTrue( + self.GetPrefsInfo().Prefs('webkit.webprefs.javascript_enabled')) + url = self.GetFileURLForDataPath( + os.path.join('javaScriptTitle.html')) + title1 = 'Title from script javascript enabled' + self.NavigateToURL(url) + self.assertEqual(title1, self.GetActiveTabTitle()) + self.SetPrefs('webkit.webprefs.javascript_enabled', False) + title = 'This is html title' + self.NavigateToURL(url) + self.assertEqual(title, self.GetActiveTabTitle()) if __name__ == '__main__': pyauto_functional.Main() |