| 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/utf_string_conversions.h" | 6 #include "base/utf_string_conversions.h" |
| 7 #include "chrome/app/chrome_command_ids.h" | 7 #include "chrome/app/chrome_command_ids.h" |
| 8 #include "chrome/browser/debugger/devtools_window.h" | 8 #include "chrome/browser/debugger/devtools_window.h" |
| 9 #include "chrome/browser/net/url_request_mock_util.h" | 9 #include "chrome/browser/net/url_request_mock_util.h" |
| 10 #include "chrome/browser/prefs/browser_prefs.h" | 10 #include "chrome/browser/prefs/browser_prefs.h" |
| (...skipping 1671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1682 ::MSG key_msg = { NULL, WM_KEYDOWN, ui::VKEY_W, 0 }; | 1682 ::MSG key_msg = { NULL, WM_KEYDOWN, ui::VKEY_W, 0 }; |
| 1683 content::NativeWebKeyboardEvent key_event(key_msg); | 1683 content::NativeWebKeyboardEvent key_event(key_msg); |
| 1684 key_event.modifiers = content::NativeWebKeyboardEvent::ControlKey; | 1684 key_event.modifiers = content::NativeWebKeyboardEvent::ControlKey; |
| 1685 #else | 1685 #else |
| 1686 content::NativeWebKeyboardEvent key_event; | 1686 content::NativeWebKeyboardEvent key_event; |
| 1687 #endif | 1687 #endif |
| 1688 panel->HandleKeyboardEvent(key_event); | 1688 panel->HandleKeyboardEvent(key_event); |
| 1689 signal.Wait(); | 1689 signal.Wait(); |
| 1690 EXPECT_EQ(0, panel_manager->num_panels()); | 1690 EXPECT_EQ(0, panel_manager->num_panels()); |
| 1691 } | 1691 } |
| 1692 |
| 1693 // Tests that icon loading might not be completed when the panel is closed. |
| 1694 // (crbug.com/151484) |
| 1695 IN_PROC_BROWSER_TEST_F(PanelBrowserTest, ClosePanelBeforeIconLoadingCompleted) { |
| 1696 // Create a test extension from the manifest with icons provided. |
| 1697 scoped_refptr<Extension> extension = LoadExtensionFromManifest( |
| 1698 FILE_PATH_LITERAL("test_extension/manifest.json")); |
| 1699 std::string extension_app_name = |
| 1700 web_app::GenerateApplicationNameFromExtensionId(extension->id()); |
| 1701 |
| 1702 // Create a panel with the extension as host. |
| 1703 CreatePanelParams params(extension_app_name, gfx::Rect(), SHOW_AS_INACTIVE); |
| 1704 // Do not wait because we want to close the panel before the callback to |
| 1705 // signal the icon loading completion is executed. |
| 1706 params.wait_for_fully_created = false; |
| 1707 Panel* panel = CreatePanelWithParams(params); |
| 1708 |
| 1709 panel->Close(); |
| 1710 } |
| OLD | NEW |