| 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 os | 6 import os |
| 7 | 7 |
| 8 import pyauto_functional | 8 import pyauto_functional |
| 9 import pyauto | 9 import pyauto |
| 10 | 10 |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 def testProcessCountFlashProcess(self): | 88 def testProcessCountFlashProcess(self): |
| 89 """Verifies the process count when the flash process is running.""" | 89 """Verifies the process count when the flash process is running.""" |
| 90 flash_url = self.GetFileURLForDataPath('plugin', 'flash.swf') | 90 flash_url = self.GetFileURLForDataPath('plugin', 'flash.swf') |
| 91 self.NavigateToURL(flash_url) | 91 self.NavigateToURL(flash_url) |
| 92 self._VerifyProcessCount(self.proc_count_fresh_profile + 1) | 92 self._VerifyProcessCount(self.proc_count_fresh_profile + 1) |
| 93 | 93 |
| 94 def testProcessCountExtensionProcess(self): | 94 def testProcessCountExtensionProcess(self): |
| 95 """Verifies the process count when an extension is installed.""" | 95 """Verifies the process count when an extension is installed.""" |
| 96 crx_file_path = os.path.abspath( | 96 crx_file_path = os.path.abspath( |
| 97 os.path.join(self.DataDir(), 'extensions', 'page_action.crx')) | 97 os.path.join(self.DataDir(), 'extensions', 'page_action.crx')) |
| 98 self.assertTrue(self.InstallExtension(crx_file_path, False), | 98 self.InstallExtension(crx_file_path) |
| 99 msg='Extension install failed.') | |
| 100 self._VerifyProcessCount(self.proc_count_fresh_profile + 1) | 99 self._VerifyProcessCount(self.proc_count_fresh_profile + 1) |
| 101 | 100 |
| 102 def testProcessCountCombination(self): | 101 def testProcessCountCombination(self): |
| 103 """Verifies process count with a combination of tabs/windows/extensions. | 102 """Verifies process count with a combination of tabs/windows/extensions. |
| 104 | 103 |
| 105 This test installs 1 extension, appends 2 tabs to the window, navigates 1 | 104 This test installs 1 extension, appends 2 tabs to the window, navigates 1 |
| 106 tab to a flash page, opens 1 new window, and appends 3 tabs to the new | 105 tab to a flash page, opens 1 new window, and appends 3 tabs to the new |
| 107 window (8 new processes expected). | 106 window (8 new processes expected). |
| 108 """ | 107 """ |
| 109 if self.IsMac(): | 108 if self.IsMac(): |
| 110 # On Mac 10.5, flash files loaded too quickly after firing browser ends | 109 # On Mac 10.5, flash files loaded too quickly after firing browser ends |
| 111 # up getting downloaded, which seems to indicate that the plugin hasn't | 110 # up getting downloaded, which seems to indicate that the plugin hasn't |
| 112 # been registered yet. | 111 # been registered yet. |
| 113 # Hack to register Flash plugin on Mac 10.5. crbug.com/94123 | 112 # Hack to register Flash plugin on Mac 10.5. crbug.com/94123 |
| 114 self.GetPluginsInfo() | 113 self.GetPluginsInfo() |
| 115 crx_file_path = os.path.abspath( | 114 crx_file_path = os.path.abspath( |
| 116 os.path.join(self.DataDir(), 'extensions', 'page_action.crx')) | 115 os.path.join(self.DataDir(), 'extensions', 'page_action.crx')) |
| 117 self.assertTrue(self.InstallExtension(crx_file_path, False), | 116 self.InstallExtension(crx_file_path) |
| 118 msg='Extension install failed.') | |
| 119 | 117 |
| 120 for _ in xrange(2): | 118 for _ in xrange(2): |
| 121 self.AppendTab(pyauto.GURL('about:blank'), 0) | 119 self.AppendTab(pyauto.GURL('about:blank'), 0) |
| 122 | 120 |
| 123 flash_url = self.GetFileURLForDataPath('plugin', 'flash.swf') | 121 flash_url = self.GetFileURLForDataPath('plugin', 'flash.swf') |
| 124 self.NavigateToURL(flash_url) | 122 self.NavigateToURL(flash_url) |
| 125 | 123 |
| 126 self.OpenNewBrowserWindow(True) | 124 self.OpenNewBrowserWindow(True) |
| 127 | 125 |
| 128 for _ in xrange(3): | 126 for _ in xrange(3): |
| 129 self.AppendTab(pyauto.GURL('about:blank'), 1) | 127 self.AppendTab(pyauto.GURL('about:blank'), 1) |
| 130 | 128 |
| 131 self._VerifyProcessCount(self.proc_count_fresh_profile + 8) | 129 self._VerifyProcessCount(self.proc_count_fresh_profile + 8) |
| 132 | 130 |
| 133 | 131 |
| 134 if __name__ == '__main__': | 132 if __name__ == '__main__': |
| 135 pyauto_functional.Main() | 133 pyauto_functional.Main() |
| OLD | NEW |