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

Unified Diff: chrome/browser/webdata/web_database_migration_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/webdata/web_data_service.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/webdata/web_database_migration_unittest.cc
diff --git a/chrome/browser/webdata/web_database_migration_unittest.cc b/chrome/browser/webdata/web_database_migration_unittest.cc
index 029c5ef276e6949dc5f43b9ff7542eb1c9041927..dcd58e841a2b775dfb936122836003ae03e48fd1 100644
--- a/chrome/browser/webdata/web_database_migration_unittest.cc
+++ b/chrome/browser/webdata/web_database_migration_unittest.cc
@@ -5,6 +5,7 @@
#include <string>
#include "base/file_util.h"
+#include "base/message_loop.h"
#include "base/scoped_temp_dir.h"
#include "base/stl_util.h"
#include "base/string16.h"
@@ -18,6 +19,7 @@
#include "chrome/browser/webdata/autofill_change.h"
#include "chrome/browser/webdata/autofill_entry.h"
#include "chrome/browser/webdata/web_database.h"
+#include "content/browser/browser_thread.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/guid.h"
#include "chrome/test/base/ui_test_utils.h"
@@ -128,7 +130,13 @@ void CreditCard32FromStatement(const sql::Statement& s,
// |WebDatabase::MigrateOldVersionsAsNeeded()|.
class WebDatabaseMigrationTest : public testing::Test {
public:
- WebDatabaseMigrationTest() {}
+ // In order to access the application locale -- which the tested functions do
+ // internally -- this test must run on the UI thread.
+ // TODO(isherman): The WebDatabase code should probably verify that it is
+ // running on the DB thread. Once that verification is added, this code will
+ // need to be updated to create both threads.
+ WebDatabaseMigrationTest()
+ : ui_thread_(BrowserThread::UI, &message_loop_for_ui_) {}
virtual ~WebDatabaseMigrationTest() {}
virtual void SetUp() {
@@ -180,6 +188,8 @@ class WebDatabaseMigrationTest : public testing::Test {
void MigrateVersion28Assertions();
private:
+ MessageLoopForUI message_loop_for_ui_;
+ BrowserThread ui_thread_;
ScopedTempDir temp_dir_;
DISALLOW_COPY_AND_ASSIGN(WebDatabaseMigrationTest);
« no previous file with comments | « chrome/browser/webdata/web_data_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698