OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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 |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 | 175 |
176 def _VerifyAppCacheInternals(self): | 176 def _VerifyAppCacheInternals(self): |
177 """Confirm about:appcache-internals contains expected content for Caches. | 177 """Confirm about:appcache-internals contains expected content for Caches. |
178 Also confirms that the about page populates Application Caches.""" | 178 Also confirms that the about page populates Application Caches.""" |
179 # Navigate to html page to activate DNS prefetching. | 179 # Navigate to html page to activate DNS prefetching. |
180 self.NavigateToURL('http://futtta.be/html5/offline.php') | 180 self.NavigateToURL('http://futtta.be/html5/offline.php') |
181 # Wait for page to load and display sucess or fail message. | 181 # Wait for page to load and display sucess or fail message. |
182 self.WaitUntil( | 182 self.WaitUntil( |
183 lambda: self.GetDOMValue('document.getElementById("status").innerHTML'), | 183 lambda: self.GetDOMValue('document.getElementById("status").innerHTML'), |
184 expect_retval='cached') | 184 expect_retval='cached') |
185 self.GetBrowserWindow(0).GetTab(0).GoBack() | 185 self.TabGoBack() |
186 test_utils.StringContentCheck( | 186 test_utils.StringContentCheck( |
187 self, self.GetTabContents(), | 187 self, self.GetTabContents(), |
188 ['Manifest', | 188 ['Manifest', |
189 'http://futtta.be/html5/manifest.php'], | 189 'http://futtta.be/html5/manifest.php'], |
190 []) | 190 []) |
191 | 191 |
192 def _VerifyAboutDNS(self): | 192 def _VerifyAboutDNS(self): |
193 """Confirm about:dns contains expected content related to DNS info. | 193 """Confirm about:dns contains expected content related to DNS info. |
194 Also confirms that prefetching DNS records propogate.""" | 194 Also confirms that prefetching DNS records propogate.""" |
195 # Navigate to a page to activate DNS prefetching. | 195 # Navigate to a page to activate DNS prefetching. |
196 self.NavigateToURL('http://www.google.com') | 196 self.NavigateToURL('http://www.google.com') |
197 self.GetBrowserWindow(0).GetTab(0).GoBack() | 197 self.TabGoBack() |
198 test_utils.StringContentCheck(self, self.GetTabContents(), | 198 test_utils.StringContentCheck(self, self.GetTabContents(), |
199 ['Host name', 'How long ago', 'Motivation'], | 199 ['Host name', 'How long ago', 'Motivation'], |
200 []) | 200 []) |
201 | 201 |
202 def _GetPlatformSpecialURLTabs(self): | 202 def _GetPlatformSpecialURLTabs(self): |
203 tabs = self.special_url_tabs.copy() | 203 tabs = self.special_url_tabs.copy() |
204 broken_tabs = self.broken_special_url_tabs.copy() | 204 broken_tabs = self.broken_special_url_tabs.copy() |
205 if self.IsChromeOS(): | 205 if self.IsChromeOS(): |
206 tabs.update(self.chromeos_special_url_tabs) | 206 tabs.update(self.chromeos_special_url_tabs) |
207 broken_tabs.update(self.broken_chromeos_special_url_tabs) | 207 broken_tabs.update(self.broken_chromeos_special_url_tabs) |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 """Test special tabs created by accelerators.""" | 317 """Test special tabs created by accelerators.""" |
318 for accel, title in self.GetSpecialAcceleratorTabs().iteritems(): | 318 for accel, title in self.GetSpecialAcceleratorTabs().iteritems(): |
319 self.RunCommand(accel) | 319 self.RunCommand(accel) |
320 self.assertTrue(self.WaitUntil( | 320 self.assertTrue(self.WaitUntil( |
321 self.GetActiveTabTitle, expect_retval=title), | 321 self.GetActiveTabTitle, expect_retval=title), |
322 msg='Expected "%s", got "%s"' % (title, self.GetActiveTabTitle())) | 322 msg='Expected "%s", got "%s"' % (title, self.GetActiveTabTitle())) |
323 | 323 |
324 | 324 |
325 if __name__ == '__main__': | 325 if __name__ == '__main__': |
326 pyauto_functional.Main() | 326 pyauto_functional.Main() |
OLD | NEW |