| 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 urllib | 7 import urllib |
| 8 | 8 |
| 9 import pyauto_functional | 9 import pyauto_functional |
| 10 import pyauto | 10 import pyauto |
| (...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 473 wait_for_display=False); | 473 wait_for_display=False); |
| 474 self.assertFalse(self.GetActiveNotifications()) | 474 self.assertFalse(self.GetActiveNotifications()) |
| 475 | 475 |
| 476 def testCloseTabWithPermissionInfobar(self): | 476 def testCloseTabWithPermissionInfobar(self): |
| 477 """Test that user can close tab when infobar present.""" | 477 """Test that user can close tab when infobar present.""" |
| 478 self.AppendTab(pyauto.GURL('about:blank')) | 478 self.AppendTab(pyauto.GURL('about:blank')) |
| 479 self.ActivateTab(0) | 479 self.ActivateTab(0) |
| 480 self.NavigateToURL(self.TEST_PAGE_URL) | 480 self.NavigateToURL(self.TEST_PAGE_URL) |
| 481 self._RequestPermission() | 481 self._RequestPermission() |
| 482 self.assertTrue(self.WaitForInfobarCount(1)) | 482 self.assertTrue(self.WaitForInfobarCount(1)) |
| 483 self.GetBrowserWindow(0).GetTab(0).Close(True) | 483 self.CloseTab() |
| 484 | 484 |
| 485 def testNavigateAwayWithPermissionInfobar(self): | 485 def testNavigateAwayWithPermissionInfobar(self): |
| 486 """Test navigating away when an infobar is present, then trying to create a | 486 """Test navigating away when an infobar is present, then trying to create a |
| 487 notification from the same page.""" | 487 notification from the same page.""" |
| 488 self.AppendTab(pyauto.GURL('about:blank')) | 488 self.AppendTab(pyauto.GURL('about:blank')) |
| 489 self.assertTrue(self.ActivateTab(0)) | 489 self.assertTrue(self.ActivateTab(0)) |
| 490 self.NavigateToURL(self.TEST_PAGE_URL) | 490 self.NavigateToURL(self.TEST_PAGE_URL) |
| 491 self._RequestPermission() | 491 self._RequestPermission() |
| 492 self.assertTrue(self.WaitForInfobarCount(1)) | 492 self.assertTrue(self.WaitForInfobarCount(1)) |
| 493 self.NavigateToURL(self.TEST_PAGE_URL) | 493 self.NavigateToURL(self.TEST_PAGE_URL) |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 537 # Since this notification has the same replaceId, 'chat', it should replace | 537 # Since this notification has the same replaceId, 'chat', it should replace |
| 538 # the first notification. | 538 # the first notification. |
| 539 self._CreateHTMLNotification(self.EMPTY_PAGE_URL, 'chat') | 539 self._CreateHTMLNotification(self.EMPTY_PAGE_URL, 'chat') |
| 540 notifications = self.GetActiveNotifications() | 540 notifications = self.GetActiveNotifications() |
| 541 self.assertEquals(1, len(notifications)) | 541 self.assertEquals(1, len(notifications)) |
| 542 self.assertEquals(self.EMPTY_PAGE_URL, notifications[0]['content_url']) | 542 self.assertEquals(self.EMPTY_PAGE_URL, notifications[0]['content_url']) |
| 543 | 543 |
| 544 | 544 |
| 545 if __name__ == '__main__': | 545 if __name__ == '__main__': |
| 546 pyauto_functional.Main() | 546 pyauto_functional.Main() |
| OLD | NEW |