Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(133)

Unified Diff: functional/browser.py

Issue 5322012: Adding tests to browser.py... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome/test/
Patch Set: Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: functional/browser.py
===================================================================
--- functional/browser.py (revision 67497)
+++ functional/browser.py (working copy)
@@ -175,7 +175,44 @@
pid2 = self.GetBrowserInfo()['windows'][0]['tabs'][0]['renderer_pid']
self.assertNotEqual(pid1, pid2)
+ def testSharingProcess(self):
Nirnimesh 2010/11/30 21:31:12 rename: testPopupSharesProcess
sunandt 2010/12/07 02:29:36 Done.
+ """Verify that parent tab and popup share a process."""
+ file_url = self.GetFileURLForPath(os.path.join(
+ self.DataDir(), 'popup_blocker', 'popup-blocked-to-post-blank.html'))
+ self.NavigateToURL(file_url)
+ blocked_popups = self.GetBlockedPopupsInfo()
+ self.assertEqual(1, len(blocked_popups), msg='Popup not blocked')
+ self.UnblockAndLaunchBlockedPopup(0)
+ self.assertEquals(2, self.GetBrowserWindowCount())
+ parent_id = self.GetBrowserInfo()['windows'][0]['tabs'][0]['renderer_pid']
Nirnimesh 2010/11/30 21:31:12 s/parent_id/parent_pid/
sunandt 2010/12/07 02:29:36 Done.
+ popup_id = self.GetBrowserInfo()['windows'][1]['tabs'][0]['renderer_pid']
Nirnimesh 2010/11/30 21:31:12 s/popup_id/popup_pid/
sunandt 2010/12/07 02:29:36 Done.
+ self.assertEquals(popup_id, parent_id,
+ msg='Parent and popup are not sharing a process.')
+ def testKillSharedProcess(self):
Nirnimesh 2010/11/30 21:31:12 rename: testKillPopupProcess
sunandt 2010/12/07 02:29:36 We are killing a process which is shared by both t
+ """Verify that killing a shared process kills all renderers."""
Nirnimesh 2010/11/30 21:31:12 Please elaborate
sunandt 2010/12/07 02:29:36 Done.
+ file_url = self.GetFileURLForPath(os.path.join(
+ self.DataDir(), 'popup_blocker', 'popup-blocked-to-post-blank.html'))
+ self.NavigateToURL(file_url)
+ blocked_popups = self.GetBlockedPopupsInfo()
+ self.assertEqual(1, len(blocked_popups), msg='Popup not blocked')
+ self.UnblockAndLaunchBlockedPopup(0)
+ self.assertEquals(2, self.GetBrowserWindowCount())
+ # Check that the renderers are alive.
+ self.assertEquals(1, self.FindInPage('pop-up')['match_count'])
+ self.assertEquals(1,
+ self.FindInPage('popup', tab_index=0, windex=1)['match_count'])
+ renderer_id = self.GetBrowserInfo()['windows'][0]['tabs'][0]['renderer_pid']
+ self.Kill(renderer_id)
+
+ # Check that the renderers are killed and their pid equals to browser pid.
+ browser_pid = self.GetBrowserInfo()['browser_pid']
+ self.assertEquals(browser_pid,
+ self.GetBrowserInfo()['windows'][0]['tabs'][0]['renderer_pid'])
+ self.assertEquals(browser_pid,
+ self.GetBrowserInfo()['windows'][1]['tabs'][0]['renderer_pid'])
+
+
if __name__ == '__main__':
pyauto_functional.Main()
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698