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 <algorithm> | 5 #include <algorithm> |
6 #include <map> | 6 #include <map> |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 virtual void TearDown(); | 192 virtual void TearDown(); |
193 | 193 |
194 // Let the DB thread run to completion of all current tasks. | 194 // Let the DB thread run to completion of all current tasks. |
195 void RunDBThread() { | 195 void RunDBThread() { |
196 base::WaitableEvent event(false, false); | 196 base::WaitableEvent event(false, false); |
197 BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, | 197 BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, |
198 base::Bind(ThreadDone, &event)); | 198 base::Bind(ThreadDone, &event)); |
199 event.Wait(); | 199 event.Wait(); |
200 // Some of the tests may post messages to the UI thread, but we don't need | 200 // Some of the tests may post messages to the UI thread, but we don't need |
201 // to run those until after the DB thread is finished. So run it here. | 201 // to run those until after the DB thread is finished. So run it here. |
202 message_loop_.RunAllPending(); | 202 message_loop_.RunUntilIdle(); |
203 } | 203 } |
204 static void ThreadDone(base::WaitableEvent* event) { | 204 static void ThreadDone(base::WaitableEvent* event) { |
205 event->Signal(); | 205 event->Signal(); |
206 } | 206 } |
207 | 207 |
208 // Utilities to help verify sets of expectations. | 208 // Utilities to help verify sets of expectations. |
209 typedef std::vector< | 209 typedef std::vector< |
210 std::pair<std::string, | 210 std::pair<std::string, |
211 std::vector<const PasswordForm*> > > ExpectationArray; | 211 std::vector<const PasswordForm*> > > ExpectationArray; |
212 void CheckPasswordForms(const std::string& folder, | 212 void CheckPasswordForms(const std::string& folder, |
(...skipping 866 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1079 CheckVersion0Pickle(true, PasswordForm::SCHEME_BASIC); | 1079 CheckVersion0Pickle(true, PasswordForm::SCHEME_BASIC); |
1080 } | 1080 } |
1081 | 1081 |
1082 TEST_F(NativeBackendKWalletPickleTest, ReadsOld64BitHTMLPickles) { | 1082 TEST_F(NativeBackendKWalletPickleTest, ReadsOld64BitHTMLPickles) { |
1083 CheckVersion0Pickle(false, PasswordForm::SCHEME_HTML); | 1083 CheckVersion0Pickle(false, PasswordForm::SCHEME_HTML); |
1084 } | 1084 } |
1085 | 1085 |
1086 TEST_F(NativeBackendKWalletPickleTest, ReadsOld64BitHTTPPickles) { | 1086 TEST_F(NativeBackendKWalletPickleTest, ReadsOld64BitHTTPPickles) { |
1087 CheckVersion0Pickle(false, PasswordForm::SCHEME_BASIC); | 1087 CheckVersion0Pickle(false, PasswordForm::SCHEME_BASIC); |
1088 } | 1088 } |
OLD | NEW |