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 // TODO(akalin): This file is basically just a unit test for | 5 // TODO(akalin): This file is basically just a unit test for |
6 // BookmarkChangeProcessor. Write unit tests for | 6 // BookmarkChangeProcessor. Write unit tests for |
7 // BookmarkModelAssociator separately. | 7 // BookmarkModelAssociator separately. |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <queue> | 10 #include <queue> |
(...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
699 int64 u3 = adds.AddURL(L"Nifty2", "ftp://nifty.andrew.cmu.edu/", f1, u2); | 699 int64 u3 = adds.AddURL(L"Nifty2", "ftp://nifty.andrew.cmu.edu/", f1, u2); |
700 // u4 is a duplicate title, different URL. | 700 // u4 is a duplicate title, different URL. |
701 adds.AddURL(L"Some old site", "http://slog.thestranger.com/", | 701 adds.AddURL(L"Some old site", "http://slog.thestranger.com/", |
702 bookmark_bar_id(), u1); | 702 bookmark_bar_id(), u1); |
703 // u5 tests an empty-string title. | 703 // u5 tests an empty-string title. |
704 std::string javascript_url( | 704 std::string javascript_url( |
705 "javascript:(function(){var w=window.open(" \ | 705 "javascript:(function(){var w=window.open(" \ |
706 "'about:blank','gnotesWin','location=0,menubar=0," \ | 706 "'about:blank','gnotesWin','location=0,menubar=0," \ |
707 "scrollbars=0,status=0,toolbar=0,width=300," \ | 707 "scrollbars=0,status=0,toolbar=0,width=300," \ |
708 "height=300,resizable');});"); | 708 "height=300,resizable');});"); |
709 adds.AddURL(L"", javascript_url, other_bookmarks_id(), 0); | 709 adds.AddURL(std::wstring(), javascript_url, other_bookmarks_id(), 0); |
710 int64 u6 = adds.AddURL(L"Sync1", "http://www.syncable.edu/", | 710 int64 u6 = adds.AddURL( |
711 mobile_bookmarks_id(), 0); | 711 L"Sync1", "http://www.syncable.edu/", mobile_bookmarks_id(), 0); |
712 | 712 |
713 syncer::ChangeRecordList::const_iterator it; | 713 syncer::ChangeRecordList::const_iterator it; |
714 // The bookmark model shouldn't yet have seen any of the nodes of |adds|. | 714 // The bookmark model shouldn't yet have seen any of the nodes of |adds|. |
715 for (it = adds.changes().begin(); it != adds.changes().end(); ++it) | 715 for (it = adds.changes().begin(); it != adds.changes().end(); ++it) |
716 ExpectBrowserNodeUnknown(it->id); | 716 ExpectBrowserNodeUnknown(it->id); |
717 | 717 |
718 adds.ApplyPendingChanges(change_processor_.get()); | 718 adds.ApplyPendingChanges(change_processor_.get()); |
719 | 719 |
720 // Make sure the bookmark model received all of the nodes in |adds|. | 720 // Make sure the bookmark model received all of the nodes in |adds|. |
721 for (it = adds.changes().begin(); it != adds.changes().end(); ++it) | 721 for (it = adds.changes().begin(); it != adds.changes().end(); ++it) |
(...skipping 1106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1828 new_versions[changed_bookmark->id()]); | 1828 new_versions[changed_bookmark->id()]); |
1829 initial_versions.erase(changed_bookmark->id()); | 1829 initial_versions.erase(changed_bookmark->id()); |
1830 ExpectTransactionVersionMatch(model_->bookmark_bar_node(), initial_versions); | 1830 ExpectTransactionVersionMatch(model_->bookmark_bar_node(), initial_versions); |
1831 ExpectTransactionVersionMatch(model_->other_node(), initial_versions); | 1831 ExpectTransactionVersionMatch(model_->other_node(), initial_versions); |
1832 ExpectTransactionVersionMatch(model_->mobile_node(), initial_versions); | 1832 ExpectTransactionVersionMatch(model_->mobile_node(), initial_versions); |
1833 } | 1833 } |
1834 | 1834 |
1835 } // namespace | 1835 } // namespace |
1836 | 1836 |
1837 } // namespace browser_sync | 1837 } // namespace browser_sync |
OLD | NEW |