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

Side by Side Diff: chrome/browser/chromeos/extensions/file_browser_notifications_browsertest.cc

Issue 10382118: Don't show system notifications while the screen is locked. (Closed) Base URL: http://git.chromium.org/git/chromium/src@master
Patch Set: Rebase Created 8 years, 7 months 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/chromeos/notifications/system_notification.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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.
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/notifications/system_notification.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698