| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env 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 os | 6 import os |
| 7 import re | 7 import re |
| 8 | 8 |
| 9 import pyauto_functional | 9 import pyauto_functional |
| 10 import pyauto | 10 import pyauto |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 self.ExecuteJavascript( | 96 self.ExecuteJavascript( |
| 97 'var element = document.getElementById("clearBrowserDataOverlay");' | 97 'var element = document.getElementById("clearBrowserDataOverlay");' |
| 98 'if(element) window.domAutomationController.send(element.nodeName);' | 98 'if(element) window.domAutomationController.send(element.nodeName);' |
| 99 'else window.domAutomationController.send("")', 1), | 99 'else window.domAutomationController.send("")', 1), |
| 100 expect_retval='DIV'), msg='Could not find the DOM UI window element.') | 100 expect_retval='DIV'), msg='Could not find the DOM UI window element.') |
| 101 | 101 |
| 102 def testViewSourceShortcut(self): | 102 def testViewSourceShortcut(self): |
| 103 """Verify view source shortcut.""" | 103 """Verify view source shortcut.""" |
| 104 self.ApplyAccelerator(pyauto.IDC_VIEW_SOURCE) | 104 self.ApplyAccelerator(pyauto.IDC_VIEW_SOURCE) |
| 105 self.assertEqual(2, self.GetTabCount(), msg='Cannot View Source.') | 105 self.assertEqual(2, self.GetTabCount(), msg='Cannot View Source.') |
| 106 self.assertEqual('view-source:about:blank', self.GetActiveTabURL().spec(), | 106 self.assertEqual('view-source:chrome://newtab/', |
| 107 msg='View Source URL is not correct.') | 107 self.GetActiveTabURL().spec()) |
| 108 | 108 |
| 109 def testDeveloperToolsShortcut(self): | 109 def testDeveloperToolsShortcut(self): |
| 110 """Verify developer tools shortcut opens developer tools window..""" | 110 """Verify developer tools shortcut opens developer tools window..""" |
| 111 # Setting the pref to undock devtools so that it can be seen | 111 # Setting the pref to undock devtools so that it can be seen |
| 112 # as a separate window. | 112 # as a separate window. |
| 113 self.SetPrefs(pyauto.kDevToolsOpenDocked, False) | 113 self.SetPrefs(pyauto.kDevToolsOpenDocked, False) |
| 114 self.ApplyAccelerator(pyauto.IDC_DEV_TOOLS) | 114 self.ApplyAccelerator(pyauto.IDC_DEV_TOOLS) |
| 115 self.assertEqual(2, self.GetBrowserWindowCount(), | 115 self.assertEqual(2, self.GetBrowserWindowCount(), |
| 116 msg='DevTools window is not open.') | 116 msg='DevTools window is not open.') |
| 117 | 117 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 self.assertEquals('Title Of Awesomeness', self.GetActiveTabTitle()) | 188 self.assertEquals('Title Of Awesomeness', self.GetActiveTabTitle()) |
| 189 # Verify forward navigation. | 189 # Verify forward navigation. |
| 190 self.RunCommand(pyauto.IDC_FORWARD) | 190 self.RunCommand(pyauto.IDC_FORWARD) |
| 191 self.assertEquals('Title Of More Awesomeness', self.GetActiveTabTitle()) | 191 self.assertEquals('Title Of More Awesomeness', self.GetActiveTabTitle()) |
| 192 | 192 |
| 193 # TODO: Open homepage shortcut. crbug.com/74103 | 193 # TODO: Open homepage shortcut. crbug.com/74103 |
| 194 | 194 |
| 195 | 195 |
| 196 if __name__ == '__main__': | 196 if __name__ == '__main__': |
| 197 pyauto_functional.Main() | 197 pyauto_functional.Main() |
| OLD | NEW |