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 1949 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2055 | 2055 |
2056 // Modify expected to include multi-valued fields. | 2056 // Modify expected to include multi-valued fields. |
2057 std::vector<string16> values; | 2057 std::vector<string16> values; |
2058 expected.GetRawMultiInfo(PHONE_HOME_WHOLE_NUMBER, &values); | 2058 expected.GetRawMultiInfo(PHONE_HOME_WHOLE_NUMBER, &values); |
2059 values.push_back(ASCIIToUTF16("(214) 555-1234")); | 2059 values.push_back(ASCIIToUTF16("(214) 555-1234")); |
2060 expected.SetRawMultiInfo(PHONE_HOME_WHOLE_NUMBER, values); | 2060 expected.SetRawMultiInfo(PHONE_HOME_WHOLE_NUMBER, values); |
2061 | 2061 |
2062 ASSERT_EQ(1U, results2.size()); | 2062 ASSERT_EQ(1U, results2.size()); |
2063 EXPECT_EQ(0, expected.Compare(*results2[0])); | 2063 EXPECT_EQ(0, expected.Compare(*results2[0])); |
2064 } | 2064 } |
OLD | NEW |