| 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/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
| 10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 | 122 |
| 123 bool HasCommandWithId(int command_id) { | 123 bool HasCommandWithId(int command_id) { |
| 124 return menu_model_.GetIndexOfCommandId(command_id) != -1; | 124 return menu_model_.GetIndexOfCommandId(command_id) != -1; |
| 125 } | 125 } |
| 126 | 126 |
| 127 void Show() override {} | 127 void Show() override {} |
| 128 | 128 |
| 129 protected: | 129 protected: |
| 130 // RenderViewContextMenu implementation. | 130 // RenderViewContextMenu implementation. |
| 131 bool GetAcceleratorForCommandId(int command_id, | 131 bool GetAcceleratorForCommandId(int command_id, |
| 132 ui::Accelerator* accelerator) override { | 132 ui::Accelerator* accelerator) const override { |
| 133 return false; | 133 return false; |
| 134 } | 134 } |
| 135 }; | 135 }; |
| 136 | 136 |
| 137 IN_PROC_BROWSER_TEST_F(PanelExtensionBrowserTest, BasicContextMenu) { | 137 IN_PROC_BROWSER_TEST_F(PanelExtensionBrowserTest, BasicContextMenu) { |
| 138 ExtensionTestMessageListener listener("panel loaded", false); | 138 ExtensionTestMessageListener listener("panel loaded", false); |
| 139 LoadExtension(test_data_dir_.AppendASCII("basic")); | 139 LoadExtension(test_data_dir_.AppendASCII("basic")); |
| 140 ASSERT_TRUE(listener.WaitUntilSatisfied()); | 140 ASSERT_TRUE(listener.WaitUntilSatisfied()); |
| 141 | 141 |
| 142 // There should only be one panel. | 142 // There should only be one panel. |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 EXPECT_FALSE(menu->HasCommandWithId(IDC_CONTENT_CONTEXT_COPYLINKLOCATION)); | 270 EXPECT_FALSE(menu->HasCommandWithId(IDC_CONTENT_CONTEXT_COPYLINKLOCATION)); |
| 271 | 271 |
| 272 // Execute the extension's custom menu item and wait for the extension's | 272 // Execute the extension's custom menu item and wait for the extension's |
| 273 // script to tell us its onclick fired. | 273 // script to tell us its onclick fired. |
| 274 ExtensionTestMessageListener onclick_listener("clicked", false); | 274 ExtensionTestMessageListener onclick_listener("clicked", false); |
| 275 int command_id = IDC_EXTENSIONS_CONTEXT_CUSTOM_FIRST; | 275 int command_id = IDC_EXTENSIONS_CONTEXT_CUSTOM_FIRST; |
| 276 ASSERT_TRUE(menu->IsCommandIdEnabled(command_id)); | 276 ASSERT_TRUE(menu->IsCommandIdEnabled(command_id)); |
| 277 menu->ExecuteCommand(command_id, 0); | 277 menu->ExecuteCommand(command_id, 0); |
| 278 EXPECT_TRUE(onclick_listener.WaitUntilSatisfied()); | 278 EXPECT_TRUE(onclick_listener.WaitUntilSatisfied()); |
| 279 } | 279 } |
| OLD | NEW |