OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/chromeos/extensions/file_browser_notifications.h" | 5 #include "chrome/browser/chromeos/extensions/file_browser_notifications.h" |
6 | 6 |
7 #include <gtest/gtest.h> | 7 #include <gtest/gtest.h> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 std::string path; | 69 std::string path; |
70 }; | 70 }; |
71 | 71 |
72 HideCallbackData hide_callback_data_; | 72 HideCallbackData hide_callback_data_; |
73 }; | 73 }; |
74 | 74 |
75 class FileBrowserNotificationsTest : public InProcessBrowserTest { | 75 class FileBrowserNotificationsTest : public InProcessBrowserTest { |
76 public: | 76 public: |
77 FileBrowserNotificationsTest() : collection_(NULL) {} | 77 FileBrowserNotificationsTest() : collection_(NULL) {} |
78 | 78 |
| 79 virtual void CleanUpOnMainThread() OVERRIDE { |
| 80 notifications_.reset(); |
| 81 } |
| 82 |
79 protected: | 83 protected: |
80 // This must be initialized late in test startup. | 84 // This must be initialized late in test startup. |
81 void InitNotifications() { | 85 void InitNotifications() { |
82 Profile* profile = browser()->profile(); | 86 Profile* profile = browser()->profile(); |
83 notifications_.reset(new MockFileBrowserNotifications(profile)); | 87 notifications_.reset(new MockFileBrowserNotifications(profile)); |
84 collection_ = | 88 collection_ = |
85 g_browser_process->notification_ui_manager()->balloon_collection(); | 89 g_browser_process->notification_ui_manager()->balloon_collection(); |
86 } | 90 } |
87 | 91 |
88 bool FindNotification(const std::string& id) { | 92 bool FindNotification(const std::string& id) { |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 | 240 |
237 // Delayed hide for a notification that doesn't exist does nothing. | 241 // Delayed hide for a notification that doesn't exist does nothing. |
238 notifications_->HideNotificationDelayed(FileBrowserNotifications::DEVICE_FAIL, | 242 notifications_->HideNotificationDelayed(FileBrowserNotifications::DEVICE_FAIL, |
239 "path", 3000); | 243 "path", 3000); |
240 notifications_->ExecuteHide(); | 244 notifications_->ExecuteHide(); |
241 ui_test_utils::RunAllPendingInMessageLoop(); | 245 ui_test_utils::RunAllPendingInMessageLoop(); |
242 EXPECT_EQ(0u, collection_->GetActiveBalloons().size()); | 246 EXPECT_EQ(0u, collection_->GetActiveBalloons().size()); |
243 } | 247 } |
244 | 248 |
245 } // namespace chromeos. | 249 } // namespace chromeos. |
OLD | NEW |