| 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 import re | 7 import re |
| 8 import types | 8 import types |
| 9 | 9 |
| 10 import pyauto_functional # Must be imported before pyauto | 10 import pyauto_functional # Must be imported before pyauto |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 self.NavigateToURL(file_url) | 143 self.NavigateToURL(file_url) |
| 144 blocked_popups = self.GetBlockedPopupsInfo() | 144 blocked_popups = self.GetBlockedPopupsInfo() |
| 145 self.assertEqual(1, len(blocked_popups), msg='Popup not blocked') | 145 self.assertEqual(1, len(blocked_popups), msg='Popup not blocked') |
| 146 self.UnblockAndLaunchBlockedPopup(0) | 146 self.UnblockAndLaunchBlockedPopup(0) |
| 147 self.assertEquals(2, self.GetBrowserWindowCount()) | 147 self.assertEquals(2, self.GetBrowserWindowCount()) |
| 148 parent_pid = self.GetBrowserInfo()['windows'][0]['tabs'][0]['renderer_pid'] | 148 parent_pid = self.GetBrowserInfo()['windows'][0]['tabs'][0]['renderer_pid'] |
| 149 popup_pid = self.GetBrowserInfo()['windows'][1]['tabs'][0]['renderer_pid'] | 149 popup_pid = self.GetBrowserInfo()['windows'][1]['tabs'][0]['renderer_pid'] |
| 150 self.assertEquals(popup_pid, parent_pid, | 150 self.assertEquals(popup_pid, parent_pid, |
| 151 msg='Parent and popup are not sharing a process.') | 151 msg='Parent and popup are not sharing a process.') |
| 152 | 152 |
| 153 def testPopupSharesSameProcessInIncognito(self): | 153 def testPopupSharesSameProcessInIncognito(self): |
| 154 """Verify parent incognito and popup share same process id""" | 154 """Verify parent incognito and popup share same process id""" |
| 155 self.RunCommand(pyauto.IDC_NEW_INCOGNITO_WINDOW) | 155 self.RunCommand(pyauto.IDC_NEW_INCOGNITO_WINDOW) |
| 156 file_url = self.GetFileURLForDataPath('popup_blocker', | 156 file_url = self.GetFileURLForDataPath('popup_blocker', |
| 157 'popup-window-open.html') | 157 'popup-window-open.html') |
| 158 self.NavigateToURL(file_url, 1, 0) | 158 self.NavigateToURL(file_url, 1, 0) |
| 159 self.UnblockAndLaunchBlockedPopup(0, tab_index=0, windex=1) | 159 self.UnblockAndLaunchBlockedPopup(0, tab_index=0, windex=1) |
| 160 self.assertEquals( | 160 self.assertEquals( |
| 161 self.GetBrowserInfo()['windows'][1]['tabs'][0]['renderer_pid'], | 161 self.GetBrowserInfo()['windows'][1]['tabs'][0]['renderer_pid'], |
| 162 self.GetBrowserInfo()['windows'][2]['tabs'][0]['renderer_pid'], | 162 self.GetBrowserInfo()['windows'][2]['tabs'][0]['renderer_pid'], |
| 163 msg='Incognito window and popup are not sharing a process id.') | 163 msg='Incognito window and popup are not sharing a process id.') |
| (...skipping 28 matching lines...) Expand all Loading... |
| 192 # Check if both are sharing a process id. | 192 # Check if both are sharing a process id. |
| 193 self.assertEquals( | 193 self.assertEquals( |
| 194 self.GetBrowserInfo()['windows'][0]['tabs'][0]['renderer_pid'], | 194 self.GetBrowserInfo()['windows'][0]['tabs'][0]['renderer_pid'], |
| 195 self.GetBrowserInfo()['windows'][1]['tabs'][0]['renderer_pid']) | 195 self.GetBrowserInfo()['windows'][1]['tabs'][0]['renderer_pid']) |
| 196 # The shared process id should be different from the previous one. | 196 # The shared process id should be different from the previous one. |
| 197 self.assertNotEqual(shared_pid, | 197 self.assertNotEqual(shared_pid, |
| 198 self.GetBrowserInfo()['windows'][0]['tabs'][0]['renderer_pid']) | 198 self.GetBrowserInfo()['windows'][0]['tabs'][0]['renderer_pid']) |
| 199 | 199 |
| 200 if __name__ == '__main__': | 200 if __name__ == '__main__': |
| 201 pyauto_functional.Main() | 201 pyauto_functional.Main() |
| OLD | NEW |