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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/guid.h" | 8 #include "base/guid.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 base::WaitableEvent done(false, false); | 85 base::WaitableEvent done(false, false); |
86 BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, | 86 BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, |
87 base::Bind(&base::WaitableEvent::Signal, base::Unretained(&done))); | 87 base::Bind(&base::WaitableEvent::Signal, base::Unretained(&done))); |
88 done.Wait(); | 88 done.Wait(); |
89 MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); | 89 MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); |
90 MessageLoop::current()->Run(); | 90 MessageLoop::current()->Run(); |
91 db_thread_.Stop(); | 91 db_thread_.Stop(); |
92 } | 92 } |
93 | 93 |
94 void ResetPersonalDataManager() { | 94 void ResetPersonalDataManager() { |
95 personal_data_.reset(new PersonalDataManager); | 95 personal_data_.reset(new PersonalDataManager("en-US")); |
96 personal_data_->Init(profile_.get()); | 96 personal_data_->Init(profile_.get()); |
97 personal_data_->AddObserver(&personal_data_observer_); | 97 personal_data_->AddObserver(&personal_data_observer_); |
98 | 98 |
99 // Verify that the web database has been updated and the notification sent. | 99 // Verify that the web database has been updated and the notification sent. |
100 EXPECT_CALL(personal_data_observer_, | 100 EXPECT_CALL(personal_data_observer_, |
101 OnPersonalDataChanged()).WillOnce(QuitUIMessageLoop()); | 101 OnPersonalDataChanged()).WillOnce(QuitUIMessageLoop()); |
102 MessageLoop::current()->Run(); | 102 MessageLoop::current()->Run(); |
103 } | 103 } |
104 | 104 |
105 MessageLoopForUI message_loop_; | 105 MessageLoopForUI message_loop_; |
(...skipping 1865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1971 | 1971 |
1972 // Modify expected to include multi-valued fields. | 1972 // Modify expected to include multi-valued fields. |
1973 std::vector<string16> values; | 1973 std::vector<string16> values; |
1974 expected.GetRawMultiInfo(PHONE_HOME_WHOLE_NUMBER, &values); | 1974 expected.GetRawMultiInfo(PHONE_HOME_WHOLE_NUMBER, &values); |
1975 values.push_back(ASCIIToUTF16("(214) 555-1234")); | 1975 values.push_back(ASCIIToUTF16("(214) 555-1234")); |
1976 expected.SetRawMultiInfo(PHONE_HOME_WHOLE_NUMBER, values); | 1976 expected.SetRawMultiInfo(PHONE_HOME_WHOLE_NUMBER, values); |
1977 | 1977 |
1978 ASSERT_EQ(1U, results2.size()); | 1978 ASSERT_EQ(1U, results2.size()); |
1979 EXPECT_EQ(0, expected.Compare(*results2[0])); | 1979 EXPECT_EQ(0, expected.Compare(*results2[0])); |
1980 } | 1980 } |
OLD | NEW |