OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <set> | 5 #include <set> |
6 #include <string> | 6 #include <string> |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 | 10 |
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
598 class WriteTransactionTest: public WriteTransaction { | 598 class WriteTransactionTest: public WriteTransaction { |
599 public: | 599 public: |
600 WriteTransactionTest(const tracked_objects::Location& from_here, | 600 WriteTransactionTest(const tracked_objects::Location& from_here, |
601 WriterTag writer, | 601 WriterTag writer, |
602 const syncable::ScopedDirLookup& directory, | 602 const syncable::ScopedDirLookup& directory, |
603 scoped_ptr<WaitableEvent>* wait_for_syncapi) | 603 scoped_ptr<WaitableEvent>* wait_for_syncapi) |
604 : WriteTransaction(from_here, writer, directory), | 604 : WriteTransaction(from_here, writer, directory), |
605 wait_for_syncapi_(wait_for_syncapi) { } | 605 wait_for_syncapi_(wait_for_syncapi) { } |
606 | 606 |
607 virtual void NotifyTransactionComplete( | 607 virtual void NotifyTransactionComplete( |
608 syncable::ModelEnumSet types) OVERRIDE { | 608 syncable::ModelTypeSet types) OVERRIDE { |
609 // This is where we differ. Force a thread change here, giving another | 609 // This is where we differ. Force a thread change here, giving another |
610 // thread a chance to create a WriteTransaction | 610 // thread a chance to create a WriteTransaction |
611 (*wait_for_syncapi_)->Wait(); | 611 (*wait_for_syncapi_)->Wait(); |
612 | 612 |
613 WriteTransaction::NotifyTransactionComplete(types); | 613 WriteTransaction::NotifyTransactionComplete(types); |
614 } | 614 } |
615 | 615 |
616 private: | 616 private: |
617 scoped_ptr<WaitableEvent>* wait_for_syncapi_; | 617 scoped_ptr<WaitableEvent>* wait_for_syncapi_; |
618 }; | 618 }; |
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1150 std::vector<AutofillEntry> sync_entries; | 1150 std::vector<AutofillEntry> sync_entries; |
1151 std::vector<AutofillProfile> sync_profiles; | 1151 std::vector<AutofillProfile> sync_profiles; |
1152 ASSERT_TRUE(GetAutofillEntriesFromSyncDB(&sync_entries, &sync_profiles)); | 1152 ASSERT_TRUE(GetAutofillEntriesFromSyncDB(&sync_entries, &sync_profiles)); |
1153 EXPECT_EQ(3U, sync_entries.size()); | 1153 EXPECT_EQ(3U, sync_entries.size()); |
1154 EXPECT_EQ(0U, sync_profiles.size()); | 1154 EXPECT_EQ(0U, sync_profiles.size()); |
1155 for (size_t i = 0; i < sync_entries.size(); i++) { | 1155 for (size_t i = 0; i < sync_entries.size(); i++) { |
1156 DVLOG(1) << "Entry " << i << ": " << sync_entries[i].key().name() | 1156 DVLOG(1) << "Entry " << i << ": " << sync_entries[i].key().name() |
1157 << ", " << sync_entries[i].key().value(); | 1157 << ", " << sync_entries[i].key().value(); |
1158 } | 1158 } |
1159 } | 1159 } |
OLD | NEW |