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

Unified Diff: chrome/browser/notifications/notification_platform_bridge_linux_unittest.cc

Issue 2867203002: Linux native notifications: fix Tsan failure in NotifyAndCloseFormat (Closed)
Patch Set: Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/notifications/notification_platform_bridge_linux_unittest.cc
diff --git a/chrome/browser/notifications/notification_platform_bridge_linux_unittest.cc b/chrome/browser/notifications/notification_platform_bridge_linux_unittest.cc
index 091791447f4e4243d73fedc4d02b5a562e441875..7a42235601dbc0e0d07abdd6cbacbd7942eb259c 100644
--- a/chrome/browser/notifications/notification_platform_bridge_linux_unittest.cc
+++ b/chrome/browser/notifications/notification_platform_bridge_linux_unittest.cc
@@ -151,9 +151,6 @@ class NotificationPlatformBridgeLinuxTest : public testing::Test {
ConnectToSignal(kFreedesktopNotificationsName,
"NotificationClosed", _, _))
.WillOnce(RegisterSignalCallback(&notification_closed_callback_));
-
- notification_bridge_linux_ =
- base::WrapUnique(new NotificationPlatformBridgeLinux(mock_bus_));
}
void TearDown() override {
@@ -166,6 +163,11 @@ class NotificationPlatformBridgeLinuxTest : public testing::Test {
}
protected:
+ void CreateNotificationBridgeLinux() {
+ notification_bridge_linux_ =
+ base::WrapUnique(new NotificationPlatformBridgeLinux(mock_bus_));
+ }
+
content::TestBrowserThreadBundle thread_bundle_;
scoped_refptr<dbus::MockBus> mock_bus_;
@@ -180,19 +182,21 @@ class NotificationPlatformBridgeLinuxTest : public testing::Test {
DISALLOW_COPY_AND_ASSIGN(NotificationPlatformBridgeLinuxTest);
};
-TEST_F(NotificationPlatformBridgeLinuxTest, SetUpAndTearDown) {}
+TEST_F(NotificationPlatformBridgeLinuxTest, SetUpAndTearDown) {
+ CreateNotificationBridgeLinux();
+}
-// Frequently triggers a data race. Disabled as flaky: https://crbug.com/719485
-TEST_F(NotificationPlatformBridgeLinuxTest, DISABLED_NotifyAndCloseFormat) {
+TEST_F(NotificationPlatformBridgeLinuxTest, NotifyAndCloseFormat) {
EXPECT_CALL(*mock_notification_proxy_.get(),
MockCallMethodAndBlock(Calls("Notify"), _))
.WillOnce(OnNotify(1));
+ EXPECT_CALL(*mock_notification_proxy_.get(),
+ MockCallMethodAndBlock(Calls("CloseNotification"), _))
+ .WillOnce(OnCloseNotification());
+
+ CreateNotificationBridgeLinux();
notification_bridge_linux_->Display(NotificationCommon::PERSISTENT, "", "",
false,
CreateNotification("id1", "", "", ""));
-
- EXPECT_CALL(*mock_notification_proxy_.get(),
- MockCallMethodAndBlock(Calls("CloseNotification"), _))
- .WillOnce(OnCloseNotification());
notification_bridge_linux_->Close("", "");
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698