| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
| 7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "base/string_number_conversions.h" | 8 #include "base/string_number_conversions.h" |
| 9 #include "chrome/browser/extensions/app_notification.h" | 9 #include "chrome/browser/extensions/app_notification.h" |
| 10 #include "chrome/browser/extensions/app_notification_manager.h" | 10 #include "chrome/browser/extensions/app_notification_manager.h" |
| (...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 564 changes.push_back(CreateSyncChange( | 564 changes.push_back(CreateSyncChange( |
| 565 syncer::SyncChange::ACTION_ADD, CreateNotification(4))); | 565 syncer::SyncChange::ACTION_ADD, CreateNotification(4))); |
| 566 | 566 |
| 567 model()->ProcessSyncChanges(FROM_HERE, changes); | 567 model()->ProcessSyncChanges(FROM_HERE, changes); |
| 568 | 568 |
| 569 EXPECT_EQ(3U, model()->GetAllSyncData(syncer::APP_NOTIFICATIONS).size()); | 569 EXPECT_EQ(3U, model()->GetAllSyncData(syncer::APP_NOTIFICATIONS).size()); |
| 570 EXPECT_EQ(2U, processor()->change_list_size()); | 570 EXPECT_EQ(2U, processor()->change_list_size()); |
| 571 } | 571 } |
| 572 | 572 |
| 573 // Process sync changes should ignore a bad ADD. | 573 // Process sync changes should ignore a bad ADD. |
| 574 TEST_F(AppNotificationManagerSyncTest, ProcessSyncChangesIgnoreBadAdd) { | 574 // Hangs: http://crbug.com/149712 |
| 575 TEST_F(AppNotificationManagerSyncTest, |
| 576 DISABLED_ProcessSyncChangesIgnoreBadAdd) { |
| 575 AppNotification* n1 = CreateNotification(1); | 577 AppNotification* n1 = CreateNotification(1); |
| 576 model()->Add(n1); | 578 model()->Add(n1); |
| 577 AppNotification* n2 = CreateNotification(2); | 579 AppNotification* n2 = CreateNotification(2); |
| 578 model()->Add(n2); | 580 model()->Add(n2); |
| 579 model()->MergeDataAndStartSyncing( | 581 model()->MergeDataAndStartSyncing( |
| 580 syncer::APP_NOTIFICATIONS, | 582 syncer::APP_NOTIFICATIONS, |
| 581 syncer::SyncDataList(), | 583 syncer::SyncDataList(), |
| 582 PassProcessor(), | 584 PassProcessor(), |
| 583 scoped_ptr<syncer::SyncErrorFactory>(new syncer::SyncErrorFactoryMock())); | 585 scoped_ptr<syncer::SyncErrorFactory>(new syncer::SyncErrorFactoryMock())); |
| 584 | 586 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 612 syncer::SyncChange::ACTION_DELETE, CreateNotification(3))); | 614 syncer::SyncChange::ACTION_DELETE, CreateNotification(3))); |
| 613 | 615 |
| 614 syncer::SyncError error = model()->ProcessSyncChanges(FROM_HERE, changes); | 616 syncer::SyncError error = model()->ProcessSyncChanges(FROM_HERE, changes); |
| 615 EXPECT_FALSE(error.IsSet()); | 617 EXPECT_FALSE(error.IsSet()); |
| 616 | 618 |
| 617 EXPECT_EQ(2U, model()->GetAllSyncData(syncer::APP_NOTIFICATIONS).size()); | 619 EXPECT_EQ(2U, model()->GetAllSyncData(syncer::APP_NOTIFICATIONS).size()); |
| 618 EXPECT_EQ(2U, processor()->change_list_size()); | 620 EXPECT_EQ(2U, processor()->change_list_size()); |
| 619 } | 621 } |
| 620 | 622 |
| 621 // Process sync changes should ignore bad UPDATEs. | 623 // Process sync changes should ignore bad UPDATEs. |
| 622 TEST_F(AppNotificationManagerSyncTest, ProcessSyncChangesIgnoreBadUpdates) { | 624 // Hangs: http://crbug.com/149712 |
| 625 TEST_F(AppNotificationManagerSyncTest, |
| 626 DISABLED_ProcessSyncChangesIgnoreBadUpdates) { |
| 623 AppNotification* n1 = CreateNotification(1); | 627 AppNotification* n1 = CreateNotification(1); |
| 624 model()->Add(n1); | 628 model()->Add(n1); |
| 625 AppNotification* n2 = CreateNotification(2); | 629 AppNotification* n2 = CreateNotification(2); |
| 626 model()->Add(n2); | 630 model()->Add(n2); |
| 627 model()->MergeDataAndStartSyncing( | 631 model()->MergeDataAndStartSyncing( |
| 628 syncer::APP_NOTIFICATIONS, | 632 syncer::APP_NOTIFICATIONS, |
| 629 syncer::SyncDataList(), | 633 syncer::SyncDataList(), |
| 630 PassProcessor(), | 634 PassProcessor(), |
| 631 scoped_ptr<syncer::SyncErrorFactory>(new syncer::SyncErrorFactoryMock())); | 635 scoped_ptr<syncer::SyncErrorFactory>(new syncer::SyncErrorFactoryMock())); |
| 632 | 636 |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 746 EXPECT_TRUE(processor()->ContainsGuid(n1->guid())); | 750 EXPECT_TRUE(processor()->ContainsGuid(n1->guid())); |
| 747 syncer::SyncChange c1 = processor()->GetChangeByGuid(n1->guid()); | 751 syncer::SyncChange c1 = processor()->GetChangeByGuid(n1->guid()); |
| 748 AssertSyncChange(c1, syncer::SyncChange::ACTION_DELETE, *n1); | 752 AssertSyncChange(c1, syncer::SyncChange::ACTION_DELETE, *n1); |
| 749 syncer::SyncChange c2 = processor()->GetChangeByGuid(n2->guid()); | 753 syncer::SyncChange c2 = processor()->GetChangeByGuid(n2->guid()); |
| 750 AssertSyncChange(c2, syncer::SyncChange::ACTION_DELETE, *n2); | 754 AssertSyncChange(c2, syncer::SyncChange::ACTION_DELETE, *n2); |
| 751 syncer::SyncChange c3 = processor()->GetChangeByGuid(n3->guid()); | 755 syncer::SyncChange c3 = processor()->GetChangeByGuid(n3->guid()); |
| 752 AssertSyncChange(c3, syncer::SyncChange::ACTION_DELETE, *n3); | 756 AssertSyncChange(c3, syncer::SyncChange::ACTION_DELETE, *n3); |
| 753 } | 757 } |
| 754 | 758 |
| 755 } // namespace extensions | 759 } // namespace extensions |
| OLD | NEW |