summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornirnimesh@chromium.org <nirnimesh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-26 00:13:07 +0000
committernirnimesh@chromium.org <nirnimesh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-26 00:13:07 +0000
commit0c9882d7bbbba90e26cd21d5b6a8a79068716184 (patch)
tree8ba64f77dfa6bf1dd089b631029cf1e62a15a845
parent2c3df19adeb8872a1cc1a9e779be9cd15c55bdc9 (diff)
downloadchromium_src-0c9882d7bbbba90e26cd21d5b6a8a79068716184.zip
chromium_src-0c9882d7bbbba90e26cd21d5b6a8a79068716184.tar.gz
chromium_src-0c9882d7bbbba90e26cd21d5b6a8a79068716184.tar.bz2
Add 2 find_in_page tests
testFindIsNotCaseSensitive testLocalizationAndCaseOrder (Tests by Deepak. Origianlly reviewed and LGTMed at: http://codereview.chromium.org/3994003/show) BUG= TEST= Review URL: http://codereview.chromium.org/4144001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63818 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/test/functional/PYAUTO_TESTS2
-rw-r--r--chrome/test/functional/find_in_page.py32
2 files changed, 34 insertions, 0 deletions
diff --git a/chrome/test/functional/PYAUTO_TESTS b/chrome/test/functional/PYAUTO_TESTS
index fccb0fc..1ef8d45 100644
--- a/chrome/test/functional/PYAUTO_TESTS
+++ b/chrome/test/functional/PYAUTO_TESTS
@@ -51,6 +51,8 @@
'-translate.TranslateTest.testBarNotVisibleOnSSLErrorPage',
# This test fails due to crbug.com/50706
'-translate.TranslateTest.testToggleTranslateOption'
+ # Turkish I problem. crbug.com/60638
+ '-find_in_page.FindMatchTests.testLocalizationAndCaseOrder',
],
'win': [
diff --git a/chrome/test/functional/find_in_page.py b/chrome/test/functional/find_in_page.py
index 3d4f359..d2e212b 100644
--- a/chrome/test/functional/find_in_page.py
+++ b/chrome/test/functional/find_in_page.py
@@ -24,6 +24,38 @@ class FindMatchTests(pyauto.PyUITest):
self.NavigateToURL(url)
self.assertEqual(0, self.FindInPage('blah')['match_count'])
+ def testFindIsNotCaseSensitive(self):
+ """Verify that find is not case sensitive.
+
+ Manually Find is case insensitive. But since FindInPage is
+ case-sensitive by default we are confirming that we get a
+ different result when we turn off case matching.
+ """
+ url = self.GetFileURLForPath(
+ os.path.join(self.DataDir(), 'find_in_page', 'largepage.html'))
+ self.NavigateToURL(url)
+ case_sensitive_result = self.FindInPage('The')['match_count']
+ case_insenstive_result = (self.FindInPage('The', match_case=False)
+ ['match_count'])
+ self.assertTrue(case_insenstive_result >= case_sensitive_result)
+
+ def testLocalizationAndCaseOrder(self):
+ """Verify that we check for localization.
+
+ Here we check the Turkish-i scenario where we verify that we
+ find both dotted and dotless I's.
+ """
+ url = self.GetFileURLForPath(
+ os.path.join(self.DataDir(), 'find_in_page', 'turkish.html'))
+ self.NavigateToURL(url)
+ dotless = self.FindInPage(u'\u0131')['match_count']
+ dotted = self.FindInPage('i')['match_count']
+ capital_i_with_dot = self.FindInPage(u'\u0130')['match_count']
+ capital_i = self.FindInPage('I')['match_count']
+ self.assertNotEqual(dotless, dotted)
+ self.assertNotEqual(capital_i_with_dot, capital_i)
+ self.assertNotEqual(dotted, capital_i_with_dot)
+
if __name__ == '__main__':
pyauto_functional.Main()