| 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/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/path_service.h" | 6 #include "base/path_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/extensions/extension_browsertest.h" | 9 #include "chrome/browser/extensions/extension_browsertest.h" |
| 10 #include "chrome/browser/extensions/extension_test_message_listener.h" | 10 #include "chrome/browser/extensions/extension_test_message_listener.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 scoped_ptr<NativePanelTesting> native_panel_testing( | 94 scoped_ptr<NativePanelTesting> native_panel_testing( |
| 95 CreateNativePanelTesting(panel)); | 95 CreateNativePanelTesting(panel)); |
| 96 EXPECT_TRUE(native_panel_testing->VerifyAppIcon()); | 96 EXPECT_TRUE(native_panel_testing->VerifyAppIcon()); |
| 97 #endif | 97 #endif |
| 98 | 98 |
| 99 panel->Close(); | 99 panel->Close(); |
| 100 } | 100 } |
| 101 | 101 |
| 102 // Tests that icon loading might not be completed when the panel is closed. | 102 // Tests that icon loading might not be completed when the panel is closed. |
| 103 // (crbug.com/151484) | 103 // (crbug.com/151484) |
| 104 // |
| 105 // TODO(linux_aura) http://crbug.com/163931 |
| 106 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(USE_AURA) |
| 107 #define MAYBE_ClosePanelBeforeIconLoadingCompleted DISABLED_ClosePanelBeforeIcon
LoadingCompleted |
| 108 #else |
| 109 #define MAYBE_ClosePanelBeforeIconLoadingCompleted ClosePanelBeforeIconLoadingCo
mpleted |
| 110 #endif |
| 104 IN_PROC_BROWSER_TEST_F(PanelExtensionBrowserTest, | 111 IN_PROC_BROWSER_TEST_F(PanelExtensionBrowserTest, |
| 105 ClosePanelBeforeIconLoadingCompleted) { | 112 MAYBE_ClosePanelBeforeIconLoadingCompleted) { |
| 106 const Extension* extension = | 113 const Extension* extension = |
| 107 LoadExtension(test_data_dir_.AppendASCII("test_extension")); | 114 LoadExtension(test_data_dir_.AppendASCII("test_extension")); |
| 108 Panel* panel = CreatePanelFromExtension(extension); | 115 Panel* panel = CreatePanelFromExtension(extension); |
| 109 | 116 |
| 110 // Close tha panel without waiting for the app icon loaded. | 117 // Close tha panel without waiting for the app icon loaded. |
| 111 panel->Close(); | 118 panel->Close(); |
| 112 } | 119 } |
| 113 | 120 |
| 114 // Non-abstract RenderViewContextMenu class for testing context menus in Panels. | 121 // Non-abstract RenderViewContextMenu class for testing context menus in Panels. |
| 115 class PanelContextMenu : public RenderViewContextMenu { | 122 class PanelContextMenu : public RenderViewContextMenu { |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 EXPECT_FALSE(menu->HasCommandWithId(IDC_SAVE_PAGE)); | 234 EXPECT_FALSE(menu->HasCommandWithId(IDC_SAVE_PAGE)); |
| 228 | 235 |
| 229 // Execute the extension's custom menu item and wait for the extension's | 236 // Execute the extension's custom menu item and wait for the extension's |
| 230 // script to tell us its onclick fired. | 237 // script to tell us its onclick fired. |
| 231 ExtensionTestMessageListener onclick_listener("clicked", false); | 238 ExtensionTestMessageListener onclick_listener("clicked", false); |
| 232 int command_id = IDC_EXTENSIONS_CONTEXT_CUSTOM_FIRST; | 239 int command_id = IDC_EXTENSIONS_CONTEXT_CUSTOM_FIRST; |
| 233 ASSERT_TRUE(menu->IsCommandIdEnabled(command_id)); | 240 ASSERT_TRUE(menu->IsCommandIdEnabled(command_id)); |
| 234 menu->ExecuteCommand(command_id); | 241 menu->ExecuteCommand(command_id); |
| 235 EXPECT_TRUE(onclick_listener.WaitUntilSatisfied()); | 242 EXPECT_TRUE(onclick_listener.WaitUntilSatisfied()); |
| 236 } | 243 } |
| OLD | NEW |