OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
7 #include "base/string_number_conversions.h" | 7 #include "base/string_number_conversions.h" |
8 #include "chrome/browser/extensions/app_notification_manager.h" | 8 #include "chrome/browser/extensions/app_notification_manager.h" |
9 #include "chrome/browser/extensions/app_notification.h" | 9 #include "chrome/browser/extensions/app_notification.h" |
10 #include "chrome/browser/sync/protocol/app_notification_specifics.pb.h" | 10 #include "chrome/browser/sync/protocol/app_notification_specifics.pb.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 | 75 |
76 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 76 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
77 profile_.reset(new TestingProfile(temp_dir_.path())); | 77 profile_.reset(new TestingProfile(temp_dir_.path())); |
78 model_ = new AppNotificationManager(profile_.get()); | 78 model_ = new AppNotificationManager(profile_.get()); |
79 model_->Init(); | 79 model_->Init(); |
80 | 80 |
81 WaitForFileThread(); | 81 WaitForFileThread(); |
82 ASSERT_TRUE(model_->loaded()); | 82 ASSERT_TRUE(model_->loaded()); |
83 } | 83 } |
84 | 84 |
85 virtual void TearDown() { } | 85 virtual void TearDown() { |
| 86 WaitForFileThread(); |
| 87 } |
86 | 88 |
87 static void PostQuitToUIThread() { | 89 static void PostQuitToUIThread() { |
88 BrowserThread::PostTask(BrowserThread::UI, | 90 BrowserThread::PostTask(BrowserThread::UI, |
89 FROM_HERE, | 91 FROM_HERE, |
90 new MessageLoop::QuitTask()); | 92 new MessageLoop::QuitTask()); |
91 } | 93 } |
92 | 94 |
93 static void WaitForFileThread() { | 95 static void WaitForFileThread() { |
94 BrowserThread::PostTask(BrowserThread::FILE, | 96 BrowserThread::PostTask(BrowserThread::FILE, |
95 FROM_HERE, | 97 FROM_HERE, |
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
572 | 574 |
573 EXPECT_EQ(3, processor()->change_list_size()); | 575 EXPECT_EQ(3, processor()->change_list_size()); |
574 EXPECT_TRUE(processor()->ContainsGuid(n1->guid())); | 576 EXPECT_TRUE(processor()->ContainsGuid(n1->guid())); |
575 SyncChange c1 = processor()->GetChangeByGuid(n1->guid()); | 577 SyncChange c1 = processor()->GetChangeByGuid(n1->guid()); |
576 AssertSyncChange(c1, SyncChange::ACTION_DELETE, *n1); | 578 AssertSyncChange(c1, SyncChange::ACTION_DELETE, *n1); |
577 SyncChange c2 = processor()->GetChangeByGuid(n2->guid()); | 579 SyncChange c2 = processor()->GetChangeByGuid(n2->guid()); |
578 AssertSyncChange(c2, SyncChange::ACTION_DELETE, *n2); | 580 AssertSyncChange(c2, SyncChange::ACTION_DELETE, *n2); |
579 SyncChange c3 = processor()->GetChangeByGuid(n3->guid()); | 581 SyncChange c3 = processor()->GetChangeByGuid(n3->guid()); |
580 AssertSyncChange(c3, SyncChange::ACTION_DELETE, *n3); | 582 AssertSyncChange(c3, SyncChange::ACTION_DELETE, *n3); |
581 } | 583 } |
OLD | NEW |