| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/ui/cocoa/apps/quit_with_apps_controller_mac.h" | 5 #include "chrome/browser/ui/cocoa/apps/quit_with_apps_controller_mac.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "chrome/browser/apps/app_browsertest_util.h" | 9 #include "chrome/browser/apps/app_browsertest_util.h" |
| 10 #include "chrome/browser/apps/app_window_registry_util.h" | 10 #include "chrome/browser/apps/app_window_registry_util.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 namespace { | 28 namespace { |
| 29 | 29 |
| 30 class QuitWithAppsControllerInteractiveTest | 30 class QuitWithAppsControllerInteractiveTest |
| 31 : public extensions::PlatformAppBrowserTest { | 31 : public extensions::PlatformAppBrowserTest { |
| 32 protected: | 32 protected: |
| 33 QuitWithAppsControllerInteractiveTest() : app_(NULL) {} | 33 QuitWithAppsControllerInteractiveTest() : app_(NULL) {} |
| 34 | 34 |
| 35 virtual ~QuitWithAppsControllerInteractiveTest() {} | 35 virtual ~QuitWithAppsControllerInteractiveTest() {} |
| 36 | 36 |
| 37 void SetUpCommandLine(CommandLine* command_line) override { | 37 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 38 PlatformAppBrowserTest::SetUpCommandLine(command_line); | 38 PlatformAppBrowserTest::SetUpCommandLine(command_line); |
| 39 command_line->AppendSwitch(switches::kAppsKeepChromeAliveInTests); | 39 command_line->AppendSwitch(switches::kAppsKeepChromeAliveInTests); |
| 40 } | 40 } |
| 41 | 41 |
| 42 const extensions::Extension* app_; | 42 const extensions::Extension* app_; |
| 43 | 43 |
| 44 private: | 44 private: |
| 45 DISALLOW_COPY_AND_ASSIGN(QuitWithAppsControllerInteractiveTest); | 45 DISALLOW_COPY_AND_ASSIGN(QuitWithAppsControllerInteractiveTest); |
| 46 }; | 46 }; |
| 47 | 47 |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 // Clicking "Quit All Apps." button closes all app windows. With no browsers | 131 // Clicking "Quit All Apps." button closes all app windows. With no browsers |
| 132 // open, this should also quit Chrome. | 132 // open, this should also quit Chrome. |
| 133 content::WindowedNotificationObserver quit_observer( | 133 content::WindowedNotificationObserver quit_observer( |
| 134 chrome::NOTIFICATION_APP_TERMINATING, | 134 chrome::NOTIFICATION_APP_TERMINATING, |
| 135 content::NotificationService::AllSources()); | 135 content::NotificationService::AllSources()); |
| 136 notification->delegate()->ButtonClick(0); | 136 notification->delegate()->ButtonClick(0); |
| 137 message_center->RemoveAllNotifications(false); | 137 message_center->RemoveAllNotifications(false); |
| 138 EXPECT_FALSE(AppWindowRegistryUtil::IsAppWindowRegisteredInAnyProfile(0)); | 138 EXPECT_FALSE(AppWindowRegistryUtil::IsAppWindowRegisteredInAnyProfile(0)); |
| 139 quit_observer.Wait(); | 139 quit_observer.Wait(); |
| 140 } | 140 } |
| OLD | NEW |