OLD | NEW |
---|---|
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 |
11 import test_utils | 11 import test_utils |
12 | 12 |
13 class SpecialTabsTest(pyauto.PyUITest): | 13 class SpecialTabsTest(pyauto.PyUITest): |
14 """TestCase for Special Tabs like about:version, chrome://history, etc.""" | 14 """TestCase for Special Tabs like about:version, chrome://history, etc.""" |
15 | 15 |
16 special_accelerator_tabs = { | 16 special_accelerator_tabs = { |
17 pyauto.IDC_SHOW_HISTORY: 'History', | 17 pyauto.IDC_SHOW_HISTORY: 'History', |
18 pyauto.IDC_MANAGE_EXTENSIONS: 'Extensions', | 18 pyauto.IDC_MANAGE_EXTENSIONS: 'Extensions', |
19 pyauto.IDC_SHOW_DOWNLOADS: 'Downloads', | 19 pyauto.IDC_SHOW_DOWNLOADS: 'Downloads', |
20 } | 20 } |
21 | 21 |
22 special_url_redirects = { | 22 special_url_redirects = { |
23 'about:': 'chrome://version', | 23 'about:': 'chrome://version', |
Nirnimesh
2011/08/26 01:23:13
Why?
| |
24 'about:about': 'chrome://about', | 24 'about:about': 'chrome://about', |
25 'about:appcache-internals': 'chrome://appcache-internals', | 25 'about:appcache-internals': 'chrome://appcache-internals', |
26 'about:credits': 'chrome://credits', | 26 'about:credits': 'chrome://credits', |
27 'about:dns': 'chrome://dns', | 27 'about:dns': 'chrome://dns', |
28 'about:histograms': 'chrome://histograms', | 28 'about:histograms': 'chrome://histograms', |
29 'about:plugins': 'chrome://plugins', | 29 'about:plugins': 'chrome://plugins', |
30 'about:sync': 'chrome://sync-internals', | 30 'about:sync': 'chrome://sync-internals', |
31 'about:sync-internals': 'chrome://sync-internals', | 31 'about:sync-internals': 'chrome://sync-internals', |
32 'about:version': 'chrome://version', | 32 'about:version': 'chrome://version', |
33 } | 33 } |
34 | 34 |
35 special_url_tabs = { | 35 special_url_tabs = { |
36 'chrome://about': { 'title': 'Chrome URLs' }, | 36 'chrome://about': { 'title': 'Chrome URLs' }, |
37 'chrome://appcache-internals': { 'title': 'AppCache Internals' }, | 37 'chrome://appcache-internals': { 'title': 'AppCache Internals' }, |
38 'chrome://blob-internals': { 'title': 'Blob Storage Internals' }, | 38 'chrome://blob-internals': { 'title': 'Blob Storage Internals' }, |
39 'chrome://bugreport': {}, | 39 'chrome://bugreport': {}, |
40 'chrome://bugreport/#0': { 'title': 'Feedback' }, | 40 'chrome://bugreport/#0': { 'title': 'Feedback' }, |
41 'chrome://chrome-urls': { 'title': 'Chrome URLs' }, | 41 'chrome://chrome-urls': { 'title': 'Chrome URLs' }, |
42 'chrome://crashes': { 'title': 'Crashes' }, | 42 'chrome://crashes': { 'title': 'Crashes' }, |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
175 'title': 'Google Chrome OS Terms', | 175 'title': 'Google Chrome OS Terms', |
176 'CSP': False | 176 'CSP': False |
177 }, | 177 }, |
178 } | 178 } |
179 broken_google_chromeos_special_url_tabs = {} | 179 broken_google_chromeos_special_url_tabs = {} |
180 | 180 |
181 google_win_special_url_tabs = {} | 181 google_win_special_url_tabs = {} |
182 broken_google_win_special_url_tabs = {} | 182 broken_google_win_special_url_tabs = {} |
183 | 183 |
184 google_mac_special_url_tabs = {} | 184 google_mac_special_url_tabs = {} |
185 broken_gogle_mac_special_url_tabs = {} | 185 broken_google_mac_special_url_tabs = {} |
186 | 186 |
187 google_linux_special_url_tabs = {} | 187 google_linux_special_url_tabs = {} |
188 broken_google_linux_special_url_tabs = {} | 188 broken_google_linux_special_url_tabs = {} |
189 | 189 |
190 def _VerifyAppCacheInternals(self): | 190 def _VerifyAppCacheInternals(self): |
191 """Confirm about:appcache-internals contains expected content for Caches. | 191 """Confirm about:appcache-internals contains expected content for Caches. |
192 Also confirms that the about page populates Application Caches.""" | 192 Also confirms that the about page populates Application Caches.""" |
193 # Navigate to html page to activate DNS prefetching. | 193 # Navigate to html page to activate DNS prefetching. |
194 self.NavigateToURL('http://static.webvm.net/appcache-test/simple.html') | 194 self.NavigateToURL('http://static.webvm.net/appcache-test/simple.html') |
195 # Wait for page to load and display sucess or fail message. | 195 # Wait for page to load and display sucess or fail message. |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
309 def testSpecialAcceratorTabs(self): | 309 def testSpecialAcceratorTabs(self): |
310 """Test special tabs created by acclerators like IDC_SHOW_HISTORY, | 310 """Test special tabs created by acclerators like IDC_SHOW_HISTORY, |
311 IDC_SHOW_DOWNLOADS.""" | 311 IDC_SHOW_DOWNLOADS.""" |
312 for accel, title in self.special_accelerator_tabs.iteritems(): | 312 for accel, title in self.special_accelerator_tabs.iteritems(): |
313 self.RunCommand(accel) | 313 self.RunCommand(accel) |
314 self.assertEqual(title, self.GetActiveTabTitle()) | 314 self.assertEqual(title, self.GetActiveTabTitle()) |
315 | 315 |
316 | 316 |
317 if __name__ == '__main__': | 317 if __name__ == '__main__': |
318 pyauto_functional.Main() | 318 pyauto_functional.Main() |
OLD | NEW |