Lines Matching refs:trans
76 void ExpectDataFromBookmarkFaviconEquals(BaseTransaction* trans,
183 WriteTransaction trans(FROM_HERE, UNITTEST, &dir);
184 MutableEntry e(&trans, GET_BY_HANDLE, written_metahandle);
186 PutDataAsBookmarkFavicon(&trans, &e, s, sizeof(s));
191 WriteTransaction trans(FROM_HERE, UNITTEST, &dir);
192 MutableEntry e(&trans, GET_BY_HANDLE, written_metahandle);
194 ExpectDataFromBookmarkFaviconEquals(&trans, &e, s, sizeof(s));
205 WriteTransaction trans(FROM_HERE, UNITTEST, &dir);
206 MutableEntry e(&trans, GET_BY_HANDLE, written_metahandle);
209 EXPECT_EQ(0, CountEntriesWithName(&trans, trans.root_id(), name));
322 ReadTransaction trans(FROM_HERE, &dir);
323 Entry me(&trans, GET_BY_CLIENT_TAG, tag);
370 ReadTransaction trans(FROM_HERE, &dir);
371 Entry me(&trans, GET_BY_CLIENT_TAG, tag);
470 void GetAllMetaHandles(BaseTransaction* trans, MetahandleSet* result) {
471 dir_->GetAllMetaHandles(trans, result);
486 ReadTransaction trans(FROM_HERE, dir_.get());
488 dir_->GetAllMetaHandles(&trans, &all_set);
494 Entry e(&trans
538 void ValidateEntry(BaseTransaction* trans,
570 WriteTransaction trans(FROM_HERE, UNITTEST, dir_.get());
572 MutableEntry e(&trans, CREATE, BOOKMARKS, trans.root_id(), "foo");
611 WriteTransaction trans(FROM_HERE, UNITTEST, dir_.get());
613 MutableEntry e(&trans, CREATE, BOOKMARKS, trans.root_id(), "foo");
634 WriteTransaction trans(FROM_HERE, UNITTEST, dir_.get());
640 MutableEntry e1(&trans, GET_BY_HANDLE, *i);
644 MutableEntry e2(&trans, CREATE, BOOKMARKS, trans.root_id(), "bar");
674 WriteTransaction trans(FROM_HERE, UNITTEST, dir_.get());
676 MutableEntry e(&trans, CREATE, BOOKMARKS, trans.root_id(), "foo");
684 WriteTransaction trans(FROM_HERE, UNITTEST, dir_.get());
690 MutableEntry e1(&trans, GET_BY_HANDLE, *i);
695 MutableEntry e2(&trans, CREATE, BOOKMARKS, trans.root_id(), "bar");
705 WriteTransaction trans(FROM_HERE, UNITTEST, dir_.get());
709 MutableEntry e(&trans, GET_BY_HANDLE, *i);
724 WriteTransaction trans(FROM_HERE, UNITTEST, dir_.get());
730 MutableEntry e(&trans, GET_BY_HANDLE, *i);
771 WriteTransaction trans(FROM_HERE, UNITTEST, dir_.get());
772 MutableEntry item1(&trans, GET_BY_ID, id1);
777 MutableEntry item2(&trans, GET_BY_ID, id2);
789 WriteTransaction trans(FROM_HERE, UNITTEST, dir_.get());
791 delete_journal->GetDeleteJournals(&trans, BOOKMARKS, &journal_entries);
796 MutableEntry item1(&trans, GET_BY_ID, id1);
799 MutableEntry item2(&trans, GET_BY_ID, id2);
812 ReadTransaction trans(FROM_HERE, dir_.get());
813 EXPECT_EQ(0u, delete_journal->GetDeleteJournalSize(&trans));
821 WriteTransaction trans(FROM_HERE, UNITTEST, dir_.get());
824 delete_journal->GetDeleteJournals(&trans, BOOKMARKS, &journal_entries);
835 delete_journal->PurgeDeleteJournals(&trans, to_purge);
850 WriteTransaction trans(FROM_HERE, UNITTEST, dir_.get());
853 delete_journal->GetDeleteJournals(&trans, BOOKMARKS, &journal_entries);
861 MutableEntry item1(&trans, GET_BY_ID, id1);
873 ReadTransaction trans(FROM_HERE, dir_.get());
875 ASSERT_EQ(0u, delete_journal->GetDeleteJournalSize(&trans));
898 WriteTransaction trans(FROM_HERE, UNITTEST, dir_.get());
899 MutableEntry e1(&trans, CREATE, BOOKMARKS, trans.root_id(), name);
902 MutableEntry e2(&trans, CREATE, BOOKMARKS, trans.root_id(), name);
905 MutableEntry e3(&trans, CREATE, BOOKMARKS, trans.root_id(), name);
922 WriteTransaction trans(FROM_HERE, UNITTEST, dir_.get());
924 dir_->GetUnsyncedMetaHandles(&trans, &handles);
927 MutableEntry e1(&trans, CREATE, BOOKMARKS, trans.root_id(), "abba");
934 MutableEntry e2(&trans, CREATE, BOOKMARKS, e1.GetId(), "bread");
942 WriteTransaction trans(FROM_HERE, UNITTEST, dir_.get());
944 dir_->GetUnsyncedMetaHandles(&trans, &handles);
947 MutableEntry e3(&trans, GET_BY_HANDLE, handle1);
953 WriteTransaction trans(FROM_HERE, UNITTEST, dir_.get());
954 dir_->GetUnsyncedMetaHandles(&trans, &handles);
958 MutableEntry e4(&trans, GET_BY_HANDLE, handle2);
964 WriteTransaction trans(FROM_HERE, UNITTEST, dir_.get());
965 dir_->GetUnsyncedMetaHandles(&trans, &handles);
974 MutableEntry e5(&trans, GET_BY_HANDLE, handle1);
982 WriteTransaction trans(FROM_HERE, UNITTEST, dir_.get());
983 dir_->GetUnsyncedMetaHandles(&trans, &handles);
994 WriteTransaction trans(FROM_HERE, UNITTEST, dir_.get());
996 dir_->GetUnappliedUpdateMetaHandles(&trans, all_types, &handles);
999 MutableEntry e1(&trans, CREATE, BOOKMARKS, trans.root_id(), "abba");
1007 MutableEntry e2(&trans, CREATE, BOOKMARKS, e1.GetId(), "bread");
1016 WriteTransaction trans(FROM_HERE, UNITTEST, dir_.get());
1018 dir_->GetUnappliedUpdateMetaHandles(&trans, all_types, &handles);
1021 MutableEntry e3(&trans, GET_BY_HANDLE, handle1);
1027 WriteTransaction trans(FROM_HERE, UNITTEST, dir_.get());
1028 dir_->GetUnappliedUpdateMetaHandles(&trans, all_types, &handles);
1032 MutableEntry e4(&trans, GET_BY_HANDLE, handle2);
1038 WriteTransaction trans(FROM_HERE, UNITTEST, dir_.get());
1039 dir_->GetUnappliedUpdateMetaHandles(&trans, all_types, &handles);
1048 MutableEntry e5(&trans, GET_BY_HANDLE, handle1);
1054 WriteTransaction trans(FROM_HERE, UNITTEST, dir_.get());
1055 dir_->GetUnappliedUpdateMetaHandles(&trans, all_types, &handles);
1099 return IsLegalNewParent(a.trans(), a.GetId(), b.GetId());
1163 WriteTransaction trans(FROM_HERE, UNITTEST, dir_.get());
1164 MutableEntry folder(&trans, CREATE, BOOKMARKS, trans.root_id(), "folder");
1170 MutableEntry entry(&trans, CREATE, BOOKMARKS, folder.GetId(), entry_name);
1179 ReadTransaction trans(FROM_HERE, dir_.get());
1180 EXPECT_EQ(0, CountEntriesWithName(&trans, trans.root_id(), entry_name));
1181 EXPECT_EQ(1, CountEntriesWithName(&trans, folder_id, entry_name));
1183 Entry entry(&trans, GET_BY_ID, entry_id);
1223 WriteTransaction trans(FROM_HERE, UNITTEST, dir_.get());
1224 MutableEntry folder(&trans, CREATE, BOOKMARKS, trans.root_id(), folder_name);
1229 EXPECT_EQ(0, CountEntriesWithName(&trans, trans.root_id(), folder_name));
1231 MutableEntry deleted(&trans, GET_BY_ID, folder.GetId());
1233 deleted.PutParentId(trans.root_id());
1236 EXPECT_EQ(0, CountEntriesWithName(&trans, trans.root_id(), folder_name));
1237 EXPECT_EQ(0, CountEntriesWithName(&trans, trans.root_id(), new_name));
1241 WriteTransaction trans(FROM_HERE, UNITTEST, dir_.get());
1242 MutableEntry folder(&trans, CREATE, BOOKMARKS, trans.root_id(), "CaseChange");
1244 folder.PutParentId(trans.root_id());
1268 WriteTransaction trans(FROM_HERE, UNITTEST, dir_.get());
1270 MutableEntry folder(&trans, CREATE, BOOKMARKS, trans.root_id(), "Folder");
1279 MutableEntry item(&trans, CREATE, BOOKMARKS, trans.root_id(), "Item");
1291 &trans, CREATE, BOOKMARKS, trans.root_id(), "Deleted Item");
1300 MutableEntry server_folder(&trans, CREATE_NEW_UPDATE_ITEM,
1309 MutableEntry server_item(&trans, CREATE_NEW_UPDATE_ITEM,
1344 WriteTransaction trans(FROM_HERE, UNITTEST, dir_.get());
1346 MutableEntry parent(&trans, CREATE, BOOKMARKS, id_factory.root(), "parent");
1350 MutableEntry child(&trans, CREATE, BOOKMARKS, parent.GetId(), "child");
1360 WriteTransaction trans(FROM_HERE, UNITTEST, dir_.get());
1362 MutableEntry parent(&trans, GET_BY_ID, orig_parent_id);
1363 MutableEntry child(&trans, GET_BY_ID, orig_child_id);
1365 ChangeEntryIDAndUpdateChildren(&trans, &child, id_factory.NewServerId());
1370 ChangeEntryIDAndUpdateChildren(&trans, &parent, id_factory.NewServerId());
1392 WriteTransaction trans(FROM_HERE, UNITTEST, dir_.get());
1394 MutableEntry parent(&trans, CREATE, BOOKMARKS, id_factory.root(), "parent");
1398 MutableEntry child(&trans, CREATE, BOOKMARKS, parent.GetId(), "child");
1407 WriteTransaction trans(FROM_HERE, UNITTEST, dir_.get());
1409 MutableEntry child(&trans, GET_BY_ID, orig_child_id);
1416 WriteTransaction trans(FROM_HERE, UNITTEST, dir_.get());
1418 MutableEntry parent(&trans, GET_BY_ID, orig_parent_id);
1420 ChangeEntryIDAndUpdateChildren(&trans, &parent, id_factory.NewServerId());
1474 WriteTransaction trans(FROM_HERE, UNITTEST, dir_.get());
1477 MutableEntry server_knows(&trans, CREATE, BOOKMARKS, id_factory.root(),
1487 &trans, CREATE, BOOKMARKS, id_factory.root(), "not_is_del");
1498 MutableEntry zombie(&trans, CREATE, BOOKMARKS, id_factory.root(), "zombie");
1507 ReadTransaction trans(FROM_HERE, dir_.get());
1511 dir_->FullyCheckTreeInvariants(&trans);
1513 Entry server_knows(&trans, GET_BY_ID, server_knows_id);
1516 Entry not_is_del(&trans, GET_BY_ID, not_is_del_id);
1519 Entry zombie(&trans, GET_BY_ID, zombie_id);
1539 WriteTransaction trans(FROM_HERE, UNITTEST, dir_.get());
1541 MutableEntry parent(&trans, CREATE, BOOKMARKS, id_factory.root(), "parent");
1545 MutableEntry child(&trans, CREATE, BOOKMARKS, parent.GetId(), "child");
1556 ReadTransaction trans(FROM_HERE, dir_.get());
1558 Entry null_ordinal_child(&trans, GET_BY_ID, null_child_id);
1721 WriteTransaction trans(FROM_HERE, UNITTEST, dir_.get());
1724 CreateTypeRoot(&trans, dir_.get(), BOOKMARKS);
1725 CreateTypeRoot(&trans, dir_.get(), PREFERENCES);
1726 CreateTypeRoot(&trans, dir_.get(), AUTOFILL);
1731 MutableEntry item1(&trans, CREATE, BOOKMARKS, trans.root_id(), "Item");
1736 MutableEntry item2(&trans, CREATE_NEW_UPDATE_ITEM,
1742 MutableEntry item3(&trans, CREATE, PREFERENCES,
1743 trans.root_id(), "Item");
1749 MutableEntry item4(&trans, CREATE_NEW_UPDATE_ITEM,
1755 MutableEntry item5(&trans, CREATE, AUTOFILL,
1756 trans.root_id(), "Item");
1762 MutableEntry item6(&trans, CREATE_NEW_UPDATE_ITEM,
1771 ReadTransaction trans(FROM_HERE, dir_.get());
1773 GetAllMetaHandles(&trans, &all_set);
1793 ReadTransaction trans(FROM_HERE, dir_.get());
1804 ReadTransaction trans(FROM_HERE, dir_.get());
1815 ReadTransaction trans(FROM_HERE, dir_.get());
1830 WriteTransaction trans(FROM_HERE, UNITTEST, dir_.get());
1832 &trans, CREATE, BOOKMARKS, trans.root_id(), create_name);
1833 MutableEntry update(&trans, CREATE_NEW_UPDATE_ITEM, update_id);
1858 ReadTransaction trans(FROM_HERE, dir_.get());
1859 Entry create(&trans, GET_BY_ID, create_id);
1860 EXPECT_EQ(1, CountEntriesWithName(&trans, trans.root_id(), create_name));
1861 Entry update(&trans, GET_BY_ID, update_id);
1930 WriteTransaction trans(FROM_HERE, UNITTEST, dir_.get());
1932 MutableEntry e1(&trans, CREATE, BOOKMARKS, trans.root_id(), "aguilera");
1947 WriteTransaction trans(FROM_HERE, UNITTEST, dir_.get());
1949 MutableEntry aguilera(&trans, GET_BY_HANDLE, handle1);
1965 WriteTransaction trans(FROM_HERE, UNITTEST, dir_.get());
1967 MutableEntry aguilera(&trans, GET_BY_HANDLE, handle1);
1979 &trans, CREATE, BOOKMARKS, trans.root_id(), "kids");
1995 ReadTransaction trans(FROM_HERE, dir_.get());
1996 Entry e1(&trans, GET_BY_HANDLE, handle1);
1999 Entry kids(&trans, GET_BY_HANDLE, handle2);
2012 WriteTransaction trans(FROM_HERE, UNITTEST, dir_.get());
2014 MutableEntry e1(&trans, CREATE, BOOKMARKS, trans.root_id(), "aguilera");
2044 void SyncableDirectoryTest::ValidateEntry(BaseTransaction* trans,
2051 Entry e(trans, GET_BY_ID, TestIdFactory::FromNumber(id));
2149 ReadTransaction trans(FROM_HERE, dir_);
2150 CHECK(1 == CountEntriesWithName(&trans, trans.root_id(), path_name));
2157 WriteTransaction trans(FROM_HERE, UNITTEST, dir_);
2158 MutableEntry e(&trans, CREATE, BOOKMARKS, trans.root_id(), path_name);
2232 ReadTransaction trans(FROM_HERE, dir_.get());
2233 Entry me(&trans, GET_BY_CLIENT_TAG, test_tag_);
2253 WriteTransaction trans(FROM_HERE, UNITTEST, dir_.get());
2254 MutableEntry me(&trans, GET_BY_CLIENT_TAG, test_tag_);
2259 ReadTransaction trans(FROM_HERE, dir_.get());
2260 Entry by_tag(&trans, GET_BY_CLIENT_TAG, test_tag_);
2263 Entry by_id(&trans, GET_BY_ID, server_id);