| 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 "base/utf_string_conversions.h" | 5 #include "base/utf_string_conversions.h" |
| 6 #include "chrome/browser/browser_process.h" | 6 #include "chrome/browser/browser_process.h" |
| 7 #include "chrome/browser/notifications/balloon.h" | 7 #include "chrome/browser/notifications/balloon.h" |
| 8 #include "chrome/browser/notifications/balloon_collection_impl.h" | 8 #include "chrome/browser/notifications/balloon_collection_impl.h" |
| 9 #include "chrome/browser/notifications/desktop_notification_service.h" | 9 #include "chrome/browser/notifications/desktop_notification_service.h" |
| 10 #include "chrome/browser/notifications/notification.h" | 10 #include "chrome/browser/notifications/notification.h" |
| 11 #include "chrome/browser/notifications/notification_ui_manager.h" | 11 #include "chrome/browser/notifications/notification_ui_manager.h" |
| 12 #include "chrome/browser/prefs/pref_service.h" | 12 #include "chrome/browser/prefs/pref_service.h" |
| 13 #include "chrome/browser/ui/browser.h" | 13 #include "chrome/browser/ui/browser.h" |
| 14 #include "chrome/browser/ui/panels/old_base_panel_browser_test.h" | 14 #include "chrome/browser/ui/panels/old_base_panel_browser_test.h" |
| 15 #include "chrome/browser/ui/panels/panel.h" | 15 #include "chrome/browser/ui/panels/panel.h" |
| 16 #include "chrome/browser/ui/panels/panel_manager.h" | 16 #include "chrome/browser/ui/panels/panel_manager.h" |
| 17 #include "chrome/browser/ui/panels/test_panel_mouse_watcher.h" | 17 #include "chrome/browser/ui/panels/test_panel_mouse_watcher.h" |
| 18 #include "chrome/common/pref_names.h" | 18 #include "chrome/common/pref_names.h" |
| 19 #include "content/public/common/show_desktop_notification_params.h" | 19 #include "content/public/common/show_desktop_notification_params.h" |
| 20 #include "ui/gfx/screen.h" | 20 #include "ui/gfx/screen.h" |
| 21 | 21 |
| 22 // Panel tests are flaking on linux CQ. http://crbug.com/135377 | |
| 23 #if !defined(OS_LINUX) | |
| 24 | |
| 25 // Desktop notification code subscribes to various panel change notifications | 22 // Desktop notification code subscribes to various panel change notifications |
| 26 // so that it knows when to adjusts balloon positions. In order to give | 23 // so that it knows when to adjusts balloon positions. In order to give |
| 27 // desktop notification code a chance to process the change notifications, | 24 // desktop notification code a chance to process the change notifications, |
| 28 // we call MessageLoopForUI::current()->RunAllPending() after any panel change | 25 // we call MessageLoopForUI::current()->RunAllPending() after any panel change |
| 29 // has been made. | 26 // has been made. |
| 30 class OldPanelAndDesktopNotificationTest : public OldBasePanelBrowserTest { | 27 class OldPanelAndDesktopNotificationTest : public OldBasePanelBrowserTest { |
| 31 public: | 28 public: |
| 32 OldPanelAndDesktopNotificationTest() : OldBasePanelBrowserTest() { | 29 OldPanelAndDesktopNotificationTest() : OldBasePanelBrowserTest() { |
| 33 } | 30 } |
| 34 | 31 |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 MessageLoopForUI::current()->RunAllPending(); | 415 MessageLoopForUI::current()->RunAllPending(); |
| 419 EXPECT_EQ(balloon_bottom_after_short_panel_created, | 416 EXPECT_EQ(balloon_bottom_after_short_panel_created, |
| 420 GetBalloonBottomPosition(balloon)); | 417 GetBalloonBottomPosition(balloon)); |
| 421 | 418 |
| 422 // Close short panel. Expect that the notification balloo moves back to its | 419 // Close short panel. Expect that the notification balloo moves back to its |
| 423 // original position. | 420 // original position. |
| 424 short_panel->Close(); | 421 short_panel->Close(); |
| 425 MessageLoopForUI::current()->RunAllPending(); | 422 MessageLoopForUI::current()->RunAllPending(); |
| 426 EXPECT_EQ(original_balloon_bottom, GetBalloonBottomPosition(balloon)); | 423 EXPECT_EQ(original_balloon_bottom, GetBalloonBottomPosition(balloon)); |
| 427 } | 424 } |
| 428 | |
| 429 #endif // !OS_LINUX | |
| OLD | NEW |