Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(230)

Unified Diff: chrome/browser/autofill/phone_number_i18n_unittest.cc

Issue 8355025: Fix an Autofill crash caused by accessing the g_browser_process on the DB thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix more tests? Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/autofill/phone_number_i18n.cc ('k') | chrome/browser/autofill/phone_number_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autofill/phone_number_i18n_unittest.cc
diff --git a/chrome/browser/autofill/phone_number_i18n_unittest.cc b/chrome/browser/autofill/phone_number_i18n_unittest.cc
index a2eb312c829c2c442b94da24f49ca9986d164fd1..b133b5508e99c4372577b9032d70d6949943d1a4 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.
« no previous file with comments | « chrome/browser/autofill/phone_number_i18n.cc ('k') | chrome/browser/autofill/phone_number_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698