| 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 urllib | 7 import urllib |
| 8 | 8 |
| 9 import pyauto_functional | 9 import pyauto_functional |
| 10 import pyauto | 10 import pyauto |
| (...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 506 self._CreateHTMLNotification(self.EMPTY_PAGE_URL) | 506 self._CreateHTMLNotification(self.EMPTY_PAGE_URL) |
| 507 self.assertEquals(1, len(self.GetActiveNotifications())) | 507 self.assertEquals(1, len(self.GetActiveNotifications())) |
| 508 self.KillRendererProcess( | 508 self.KillRendererProcess( |
| 509 self.GetBrowserInfo()['windows'][0]['tabs'][0]['renderer_pid']) | 509 self.GetBrowserInfo()['windows'][0]['tabs'][0]['renderer_pid']) |
| 510 self.assertEquals(1, len(self.GetActiveNotifications())) | 510 self.assertEquals(1, len(self.GetActiveNotifications())) |
| 511 | 511 |
| 512 def testNotificationOrderAfterClosingOne(self): | 512 def testNotificationOrderAfterClosingOne(self): |
| 513 """Tests that closing a notification leaves the rest | 513 """Tests that closing a notification leaves the rest |
| 514 of the notifications in the correct order. | 514 of the notifications in the correct order. |
| 515 """ | 515 """ |
| 516 if self.IsWin7(): |
| 517 return # crbug.com/66072 |
| 516 self._AllowAllOrigins() | 518 self._AllowAllOrigins() |
| 517 self.NavigateToURL(self.TEST_PAGE_URL) | 519 self.NavigateToURL(self.TEST_PAGE_URL) |
| 518 self._CreateSimpleNotification('', 'Title1', '') | 520 self._CreateSimpleNotification('', 'Title1', '') |
| 519 self._CreateSimpleNotification('', 'Title2', '') | 521 self._CreateSimpleNotification('', 'Title2', '') |
| 520 self._CreateSimpleNotification('', 'Title3', '') | 522 self._CreateSimpleNotification('', 'Title3', '') |
| 521 old_notifications = self.GetAllNotifications() | 523 old_notifications = self.GetAllNotifications() |
| 522 self.assertEquals(3, len(old_notifications)) | 524 self.assertEquals(3, len(old_notifications)) |
| 523 self.CloseNotification(1) | 525 self.CloseNotification(1) |
| 524 new_notifications = self.GetAllNotifications() | 526 new_notifications = self.GetAllNotifications() |
| 525 self.assertEquals(2, len(new_notifications)) | 527 self.assertEquals(2, len(new_notifications)) |
| 526 self.assertEquals(old_notifications[0]['id'], new_notifications[0]['id']) | 528 self.assertEquals(old_notifications[0]['id'], new_notifications[0]['id']) |
| 527 self.assertEquals(old_notifications[2]['id'], new_notifications[1]['id']) | 529 self.assertEquals(old_notifications[2]['id'], new_notifications[1]['id']) |
| 528 | 530 |
| 529 def testNotificationReplacement(self): | 531 def testNotificationReplacement(self): |
| 530 """Test that we can replace a notification using the replaceId.""" | 532 """Test that we can replace a notification using the replaceId.""" |
| 531 self._AllowAllOrigins() | 533 self._AllowAllOrigins() |
| 532 self.NavigateToURL(self.TEST_PAGE_URL) | 534 self.NavigateToURL(self.TEST_PAGE_URL) |
| 533 self._CreateSimpleNotification('', 'Title2', '', 'chat') | 535 self._CreateSimpleNotification('', 'Title2', '', 'chat') |
| 534 self.WaitForNotificationCount(1) | 536 self.WaitForNotificationCount(1) |
| 535 # Since this notification has the same replaceId, 'chat', it should replace | 537 # Since this notification has the same replaceId, 'chat', it should replace |
| 536 # the first notification. | 538 # the first notification. |
| 537 self._CreateHTMLNotification(self.EMPTY_PAGE_URL, 'chat') | 539 self._CreateHTMLNotification(self.EMPTY_PAGE_URL, 'chat') |
| 538 notifications = self.GetActiveNotifications() | 540 notifications = self.GetActiveNotifications() |
| 539 self.assertEquals(1, len(notifications)) | 541 self.assertEquals(1, len(notifications)) |
| 540 self.assertEquals(self.EMPTY_PAGE_URL, notifications[0]['content_url']) | 542 self.assertEquals(self.EMPTY_PAGE_URL, notifications[0]['content_url']) |
| 541 | 543 |
| 542 | 544 |
| 543 if __name__ == '__main__': | 545 if __name__ == '__main__': |
| 544 pyauto_functional.Main() | 546 pyauto_functional.Main() |
| OLD | NEW |