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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/bind.h" | 6 #include "base/bind.h" |
7 #include "base/bind_helpers.h" | 7 #include "base/bind_helpers.h" |
8 #include "base/scoped_temp_dir.h" | 8 #include "base/scoped_temp_dir.h" |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 136 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
137 MessageLoop::current()->Quit(); | 137 MessageLoop::current()->Quit(); |
138 } | 138 } |
139 | 139 |
140 TEST_F(PasswordStoreDefaultTest, NonASCIIData) { | 140 TEST_F(PasswordStoreDefaultTest, NonASCIIData) { |
141 scoped_refptr<PasswordStoreDefault> store( | 141 scoped_refptr<PasswordStoreDefault> store( |
142 new PasswordStoreDefault(login_db_.release(), profile_.get())); | 142 new PasswordStoreDefault(login_db_.release(), profile_.get())); |
143 store->Init(); | 143 store->Init(); |
144 | 144 |
145 // Some non-ASCII password form data. | 145 // Some non-ASCII password form data. |
146 PasswordFormData form_data[] = { | 146 static const PasswordFormData form_data[] = { |
147 { PasswordForm::SCHEME_HTML, | 147 { PasswordForm::SCHEME_HTML, |
148 "http://foo.example.com", | 148 "http://foo.example.com", |
149 "http://foo.example.com/origin", | 149 "http://foo.example.com/origin", |
150 "http://foo.example.com/action", | 150 "http://foo.example.com/action", |
151 L"มีสีสัน", | 151 L"มีสีสัน", |
152 L"お元気ですか?", | 152 L"お元気ですか?", |
153 L"盆栽", | 153 L"盆栽", |
154 L"أحب كرة", | 154 L"أحب كرة", |
155 L"£éä국수çà", | 155 L"£éä국수çà", |
156 true, false, 1 }, | 156 true, false, 1 }, |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 // Deleting the login should trigger a notification. | 267 // Deleting the login should trigger a notification. |
268 store->RemoveLogin(*form); | 268 store->RemoveLogin(*form); |
269 | 269 |
270 // Wait for PasswordStore to send the notification. | 270 // Wait for PasswordStore to send the notification. |
271 BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, | 271 BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, |
272 base::Bind(&WaitableEvent::Signal, base::Unretained(&done))); | 272 base::Bind(&WaitableEvent::Signal, base::Unretained(&done))); |
273 done.Wait(); | 273 done.Wait(); |
274 | 274 |
275 store->ShutdownOnUIThread(); | 275 store->ShutdownOnUIThread(); |
276 } | 276 } |
OLD | NEW |