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/message_loop.h" | 6 #include "base/message_loop.h" |
7 #include "chrome/browser/extensions/app_notification_manager.h" | 7 #include "chrome/browser/extensions/app_notification_manager.h" |
8 #include "chrome/browser/extensions/app_notification_test_util.h" | 8 #include "chrome/browser/extensions/app_notification_test_util.h" |
9 #include "chrome/common/chrome_notification_types.h" | 9 #include "chrome/common/chrome_notification_types.h" |
10 #include "chrome/common/extensions/extension.h" | 10 #include "chrome/common/extensions/extension.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 if (mgr_.get()) | 47 if (mgr_.get()) |
48 WaitForFileThread(); | 48 WaitForFileThread(); |
49 mgr_ = new AppNotificationManager(profile_.get()); | 49 mgr_ = new AppNotificationManager(profile_.get()); |
50 mgr_->Init(); | 50 mgr_->Init(); |
51 WaitForFileThread(); | 51 WaitForFileThread(); |
52 } | 52 } |
53 | 53 |
54 static void PostQuitToUIThread() { | 54 static void PostQuitToUIThread() { |
55 BrowserThread::PostTask(BrowserThread::UI, | 55 BrowserThread::PostTask(BrowserThread::UI, |
56 FROM_HERE, | 56 FROM_HERE, |
57 new MessageLoop::QuitTask()); | 57 MessageLoop::QuitClosure()); |
58 } | 58 } |
59 | 59 |
60 static void WaitForFileThread() { | 60 static void WaitForFileThread() { |
61 BrowserThread::PostTask(BrowserThread::FILE, | 61 BrowserThread::PostTask(BrowserThread::FILE, |
62 FROM_HERE, | 62 FROM_HERE, |
63 base::Bind(&PostQuitToUIThread)); | 63 base::Bind(&PostQuitToUIThread)); |
64 MessageLoop::current()->Run(); | 64 MessageLoop::current()->Run(); |
65 } | 65 } |
66 | 66 |
67 MessageLoop ui_loop_; | 67 MessageLoop ui_loop_; |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 content::NotificationService::current()->Notify( | 120 content::NotificationService::current()->Notify( |
121 chrome::NOTIFICATION_EXTENSION_UNINSTALLED, | 121 chrome::NOTIFICATION_EXTENSION_UNINSTALLED, |
122 content::Source<Profile>(profile_.get()), | 122 content::Source<Profile>(profile_.get()), |
123 content::Details<const std::string>(&id1)); | 123 content::Details<const std::string>(&id1)); |
124 | 124 |
125 // The id1 items should be gone but the id2 items should still be there. | 125 // The id1 items should be gone but the id2 items should still be there. |
126 EXPECT_EQ(NULL, mgr_->GetLast(id1)); | 126 EXPECT_EQ(NULL, mgr_->GetLast(id1)); |
127 EXPECT_EQ(NULL, mgr_->GetAll(id1)); | 127 EXPECT_EQ(NULL, mgr_->GetAll(id1)); |
128 util::ExpectListsEqual(list2, *mgr_->GetAll(id2)); | 128 util::ExpectListsEqual(list2, *mgr_->GetAll(id2)); |
129 } | 129 } |
OLD | NEW |