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/bind.h" | 5 #include "base/bind.h" |
6 #include "base/prefs/pref_service.h" | 6 #include "base/prefs/pref_service.h" |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chrome/app/chrome_command_ids.h" | 8 #include "chrome/app/chrome_command_ids.h" |
9 #include "chrome/browser/devtools/devtools_window.h" | 9 #include "chrome/browser/devtools/devtools_window.h" |
10 #include "chrome/browser/extensions/extension_apitest.h" | 10 #include "chrome/browser/extensions/extension_apitest.h" |
(...skipping 1481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1492 Panel* panel_other = CreatePanel(extension_app_name_other); | 1492 Panel* panel_other = CreatePanel(extension_app_name_other); |
1493 | 1493 |
1494 content::WindowedNotificationObserver signal( | 1494 content::WindowedNotificationObserver signal( |
1495 chrome::NOTIFICATION_PANEL_CLOSED, | 1495 chrome::NOTIFICATION_PANEL_CLOSED, |
1496 content::Source<Panel>(panel)); | 1496 content::Source<Panel>(panel)); |
1497 content::WindowedNotificationObserver signal1( | 1497 content::WindowedNotificationObserver signal1( |
1498 chrome::NOTIFICATION_PANEL_CLOSED, | 1498 chrome::NOTIFICATION_PANEL_CLOSED, |
1499 content::Source<Panel>(panel1)); | 1499 content::Source<Panel>(panel1)); |
1500 | 1500 |
1501 // Send unload notification on the first extension. | 1501 // Send unload notification on the first extension. |
1502 extensions::UnloadedExtensionInfo details(extension, | 1502 extensions::UnloadedExtensionInfo details( |
1503 extension_misc::UNLOAD_REASON_UNINSTALL); | 1503 extension.get(), extension_misc::UNLOAD_REASON_UNINSTALL); |
1504 content::NotificationService::current()->Notify( | 1504 content::NotificationService::current()->Notify( |
1505 chrome::NOTIFICATION_EXTENSION_UNLOADED, | 1505 chrome::NOTIFICATION_EXTENSION_UNLOADED, |
1506 content::Source<Profile>(browser()->profile()), | 1506 content::Source<Profile>(browser()->profile()), |
1507 content::Details<extensions::UnloadedExtensionInfo>(&details)); | 1507 content::Details<extensions::UnloadedExtensionInfo>(&details)); |
1508 | 1508 |
1509 // Wait for the panels opened by the first extension to close. | 1509 // Wait for the panels opened by the first extension to close. |
1510 signal.Wait(); | 1510 signal.Wait(); |
1511 signal1.Wait(); | 1511 signal1.Wait(); |
1512 | 1512 |
1513 // Verify that the panel that's left is the panel from the second extension. | 1513 // Verify that the panel that's left is the panel from the second extension. |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1822 #else | 1822 #else |
1823 #define MAYBE_FocusChangeEventOnMinimize FocusChangeEventOnMinimize | 1823 #define MAYBE_FocusChangeEventOnMinimize FocusChangeEventOnMinimize |
1824 #endif | 1824 #endif |
1825 IN_PROC_BROWSER_TEST_F(PanelExtensionApiTest, | 1825 IN_PROC_BROWSER_TEST_F(PanelExtensionApiTest, |
1826 MAYBE_FocusChangeEventOnMinimize) { | 1826 MAYBE_FocusChangeEventOnMinimize) { |
1827 // This is needed so the subsequently created panels can be activated. | 1827 // This is needed so the subsequently created panels can be activated. |
1828 // On a Mac, it transforms background-only test process into foreground one. | 1828 // On a Mac, it transforms background-only test process into foreground one. |
1829 ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); | 1829 ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); |
1830 ASSERT_TRUE(RunExtensionTest("panels/focus_change_on_minimize")) << message_; | 1830 ASSERT_TRUE(RunExtensionTest("panels/focus_change_on_minimize")) << message_; |
1831 } | 1831 } |
OLD | NEW |