diff options
author | isherman@chromium.org <isherman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-22 00:46:18 +0000 |
---|---|---|
committer | isherman@chromium.org <isherman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-22 00:46:18 +0000 |
commit | 05871b35bc823da2edc82d296781659f79d0660f (patch) | |
tree | ebdb7f59a6590e40640893c1c30b1532f3067038 /chrome/browser/autofill/phone_number_i18n_unittest.cc | |
parent | fc9bf18faf17def62fc122dd5df7bbf57c7ea0ce (diff) | |
download | chromium_src-05871b35bc823da2edc82d296781659f79d0660f.zip chromium_src-05871b35bc823da2edc82d296781659f79d0660f.tar.gz chromium_src-05871b35bc823da2edc82d296781659f79d0660f.tar.bz2 |
Fix an Autofill crash caused by accessing the g_browser_process on the DB thread.
This is meant as a minimal-impact CL, so that it should be safe to merge to M16. The more complete fix is being tracked in bug 100845.
BUG=100745
TEST=less crashy
Review URL: http://codereview.chromium.org/8355025
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106822 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autofill/phone_number_i18n_unittest.cc')
-rw-r--r-- | chrome/browser/autofill/phone_number_i18n_unittest.cc | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/chrome/browser/autofill/phone_number_i18n_unittest.cc b/chrome/browser/autofill/phone_number_i18n_unittest.cc index a2eb312..b133b55 100644 --- a/chrome/browser/autofill/phone_number_i18n_unittest.cc +++ b/chrome/browser/autofill/phone_number_i18n_unittest.cc @@ -2,8 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/message_loop.h" #include "base/utf_string_conversions.h" #include "chrome/browser/autofill/phone_number_i18n.h" +#include "content/browser/browser_thread.h" #include "testing/gtest/include/gtest/gtest.h" using autofill_i18n::NormalizePhoneNumber; @@ -11,7 +13,18 @@ using autofill_i18n::ParsePhoneNumber; using autofill_i18n::ConstructPhoneNumber; using autofill_i18n::PhoneNumbersMatch; -typedef testing::Test PhoneNumberI18NTest; +class PhoneNumberI18NTest : public testing::Test { + public: + // In order to access the application locale -- which the tested functions do + // internally -- this test must run on the UI thread. + PhoneNumberI18NTest() : ui_thread_(BrowserThread::UI, &message_loop_) {} + + private: + MessageLoopForUI message_loop_; + BrowserThread ui_thread_; + + DISALLOW_COPY_AND_ASSIGN(PhoneNumberI18NTest); +}; TEST_F(PhoneNumberI18NTest, NormalizePhoneNumber) { // "Large" digits. |