Adding a pyauto test, testPopupSharesProcessWithIncognito, in browser.py

BUG=NONE
TEST=NONE

This test is to verify that popup process launched through incognito shares a process id with it's parent process

Review URL: http://codereview.chromium.org/7068032
Patch from Jasneet <jasneet@chromium.org>.

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@88429 0039d316-1c4b-4281-b951-d872f2087c98
parent f3d59d04
...@@ -150,6 +150,18 @@ class BrowserTest(pyauto.PyUITest): ...@@ -150,6 +150,18 @@ class BrowserTest(pyauto.PyUITest):
self.assertEquals(popup_pid, parent_pid, self.assertEquals(popup_pid, parent_pid,
msg='Parent and popup are not sharing a process.') msg='Parent and popup are not sharing a process.')
def testPopupSharesSameProcessInIncognito(self):
"""Verify parent incognito and popup share same process id"""
self.RunCommand(pyauto.IDC_NEW_INCOGNITO_WINDOW)
file_url = self.GetFileURLForDataPath('popup_blocker',
'popup-window-open.html')
self.NavigateToURL(file_url, 1, 0)
self.UnblockAndLaunchBlockedPopup(0, tab_index=0, windex=1)
self.assertEquals(
self.GetBrowserInfo()['windows'][1]['tabs'][0]['renderer_pid'],
self.GetBrowserInfo()['windows'][2]['tabs'][0]['renderer_pid'],
msg='Incognito window and popup are not sharing a process id.')
def testKillAndReloadSharedProcess(self): def testKillAndReloadSharedProcess(self):
"""Verify that killing a shared process kills all associated renderers. """Verify that killing a shared process kills all associated renderers.
In this case we are killing a process shared by a parent and In this case we are killing a process shared by a parent and
...@@ -185,6 +197,5 @@ class BrowserTest(pyauto.PyUITest): ...@@ -185,6 +197,5 @@ class BrowserTest(pyauto.PyUITest):
self.assertNotEqual(shared_pid, self.assertNotEqual(shared_pid,
self.GetBrowserInfo()['windows'][0]['tabs'][0]['renderer_pid']) self.GetBrowserInfo()['windows'][0]['tabs'][0]['renderer_pid'])
if __name__ == '__main__': if __name__ == '__main__':
pyauto_functional.Main() pyauto_functional.Main()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment