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

Unified Diff: chrome/browser/sync/glue/typed_url_model_associator_unittest.cc

Issue 59793008: sync: don't allow NULL profile in ProfileSyncService and friends (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix test Created 7 years, 1 month 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
Index: chrome/browser/sync/glue/typed_url_model_associator_unittest.cc
diff --git a/chrome/browser/sync/glue/typed_url_model_associator_unittest.cc b/chrome/browser/sync/glue/typed_url_model_associator_unittest.cc
index c777163282dd6a21110660e6fb39740557ada837..e5148760f69560219a187385f58e75fb1f09ce06 100644
--- a/chrome/browser/sync/glue/typed_url_model_associator_unittest.cc
+++ b/chrome/browser/sync/glue/typed_url_model_associator_unittest.cc
@@ -65,21 +65,14 @@ class SyncTypedUrlModelAssociatorTest : public testing::Test {
}
};
-class TestTypedUrlModelAssociator : public TypedUrlModelAssociator {
- public:
- TestTypedUrlModelAssociator()
- : TypedUrlModelAssociator(&mock_, NULL, NULL) {}
- private:
- ProfileSyncServiceMock mock_;
-};
-
static void CreateModelAssociatorAsync(base::WaitableEvent* startup,
base::WaitableEvent* aborted,
base::WaitableEvent* done,
- TypedUrlModelAssociator** associator) {
+ TypedUrlModelAssociator** associator,
+ ProfileSyncServiceMock* mock) {
// Grab the done lock - when we exit, this will be released and allow the
// test to finish.
- *associator = new TestTypedUrlModelAssociator();
+ *associator = new TypedUrlModelAssociator(mock, NULL, NULL);
// Signal frontend to call AbortAssociation and proceed after it's called.
startup->Signal();
@@ -419,12 +412,15 @@ TEST_F(SyncTypedUrlModelAssociatorTest, TestAbort) {
base::WaitableEvent startup(false, false);
base::WaitableEvent aborted(false, false);
base::WaitableEvent done(false, false);
- TypedUrlModelAssociator* associator;
+ TestingProfile profile;
+ ProfileSyncServiceMock mock(&profile);
+ TypedUrlModelAssociator* associator(NULL);
// Fire off to the DB thread to create the model associator and start
// model association.
db_thread.Start();
base::Closure callback = base::Bind(
- &CreateModelAssociatorAsync, &startup, &aborted, &done, &associator);
+ &CreateModelAssociatorAsync, &startup, &aborted, &done, &associator,
+ &mock);
BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, callback);
// Wait for the model associator to get created and start assocation.
ASSERT_TRUE(startup.TimedWait(TestTimeouts::action_timeout()));

Powered by Google App Engine
This is Rietveld 408576698