Index: trunk/src/chrome/browser/predictors/autocomplete_action_predictor_table_unittest.cc |
=================================================================== |
--- trunk/src/chrome/browser/predictors/autocomplete_action_predictor_table_unittest.cc (revision 219785) |
+++ trunk/src/chrome/browser/predictors/autocomplete_action_predictor_table_unittest.cc (working copy) |
@@ -4,15 +4,14 @@ |
#include <vector> |
-#include "base/run_loop.h" |
+#include "base/message_loop/message_loop.h" |
#include "base/strings/utf_string_conversions.h" |
#include "base/time/time.h" |
#include "chrome/browser/predictors/autocomplete_action_predictor_table.h" |
#include "chrome/browser/predictors/predictor_database.h" |
#include "chrome/browser/predictors/predictor_database_factory.h" |
#include "chrome/test/base/testing_profile.h" |
-#include "content/public/browser/browser_thread.h" |
-#include "content/public/test/test_browser_thread_bundle.h" |
+#include "content/public/test/test_browser_thread.h" |
#include "sql/statement.h" |
#include "testing/gtest/include/gtest/gtest.h" |
@@ -25,7 +24,10 @@ |
namespace predictors { |
class AutocompleteActionPredictorTableTest : public testing::Test { |
- protected: |
+ public: |
+ AutocompleteActionPredictorTableTest(); |
+ virtual ~AutocompleteActionPredictorTableTest(); |
+ |
virtual void SetUp(); |
virtual void TearDown(); |
@@ -38,6 +40,8 @@ |
TestingProfile* profile() { return &profile_; } |
+ protected: |
+ |
// Test functions that can be run against this text fixture or |
// AutocompleteActionPredictorTableReopenTest that inherits from this. |
void TestGetRow(); |
@@ -48,14 +52,15 @@ |
AutocompleteActionPredictorTable::Rows test_db_; |
private: |
- content::TestBrowserThreadBundle thread_bundle_; |
TestingProfile profile_; |
scoped_ptr<PredictorDatabase> db_; |
+ base::MessageLoop loop_; |
+ content::TestBrowserThread db_thread_; |
}; |
class AutocompleteActionPredictorTableReopenTest |
: public AutocompleteActionPredictorTableTest { |
- protected: |
+ public: |
virtual void SetUp() { |
// By calling SetUp twice, we make sure that the table already exists for |
// this fixture. |
@@ -65,9 +70,17 @@ |
} |
}; |
+AutocompleteActionPredictorTableTest::AutocompleteActionPredictorTableTest() |
+ : loop_(base::MessageLoop::TYPE_DEFAULT), |
+ db_thread_(BrowserThread::DB, &loop_) { |
+} |
+ |
+AutocompleteActionPredictorTableTest::~AutocompleteActionPredictorTableTest() { |
+} |
+ |
void AutocompleteActionPredictorTableTest::SetUp() { |
db_.reset(new PredictorDatabase(&profile_)); |
- base::RunLoop().RunUntilIdle(); |
+ loop_.RunUntilIdle(); |
test_db_.push_back(AutocompleteActionPredictorTable::Row( |
"BD85DBA2-8C29-49F9-84AE-48E1E90880DF", |
@@ -85,7 +98,7 @@ |
void AutocompleteActionPredictorTableTest::TearDown() { |
db_.reset(NULL); |
- base::RunLoop().RunUntilIdle(); |
+ loop_.RunUntilIdle(); |
test_db_.clear(); |
} |