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

Unified Diff: chrome/browser/autofill/address_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 | « no previous file | chrome/browser/autofill/autofill_country.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autofill/address_unittest.cc
diff --git a/chrome/browser/autofill/address_unittest.cc b/chrome/browser/autofill/address_unittest.cc
index 10d2414699a33ba4bad96f2d192b0cd11e88c615..fa4069b2eccbe2fd1ba88cbffa572449f3d072a0 100644
--- a/chrome/browser/autofill/address_unittest.cc
+++ b/chrome/browser/autofill/address_unittest.cc
@@ -4,13 +4,26 @@
#include <string>
+#include "base/message_loop.h"
#include "base/string16.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/autofill/address.h"
#include "chrome/browser/autofill/autofill_type.h"
+#include "content/browser/browser_thread.h"
#include "testing/gtest/include/gtest/gtest.h"
-typedef testing::Test AddressTest;
+class AddressTest : 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.
+ AddressTest() : ui_thread_(BrowserThread::UI, &message_loop_) {}
+
+ private:
+ MessageLoopForUI message_loop_;
+ BrowserThread ui_thread_;
+
+ DISALLOW_COPY_AND_ASSIGN(AddressTest);
+};
// Test that the getters and setters for country code are working.
TEST_F(AddressTest, CountryCode) {
« no previous file with comments | « no previous file | chrome/browser/autofill/autofill_country.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698