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 #import "chrome/browser/ui/cocoa/extensions/extension_action_context_menu.h" | 5 #import "chrome/browser/ui/cocoa/extensions/extension_action_context_menu.h" |
6 | 6 |
7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/json/json_file_value_serializer.h" | 9 #include "base/json/json_file_value_serializer.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 | 81 |
82 service->SetBoolean(prefs::kExtensionsUIDeveloperMode, false); | 82 service->SetBoolean(prefs::kExtensionsUIDeveloperMode, false); |
83 EXPECT_TRUE([inspectItem isHidden]); | 83 EXPECT_TRUE([inspectItem isHidden]); |
84 | 84 |
85 service->SetBoolean(prefs::kExtensionsUIDeveloperMode, original); | 85 service->SetBoolean(prefs::kExtensionsUIDeveloperMode, original); |
86 } | 86 } |
87 | 87 |
88 // Test that browser action context menus work. Browser actions have their | 88 // Test that browser action context menus work. Browser actions have their |
89 // menus created during browser initialization, when there is no tab. This | 89 // menus created during browser initialization, when there is no tab. This |
90 // test simulates that and checks the menu is operational. | 90 // test simulates that and checks the menu is operational. |
91 IN_PROC_BROWSER_TEST_F(ExtensionActionContextMenuTest, BrowserAction) { | 91 // TODO(atwilson): Re-enable this test with a change to free the browser |
| 92 // properly in a way that does not leave dangling references in the |
| 93 // ToolbarController. |
| 94 IN_PROC_BROWSER_TEST_F(ExtensionActionContextMenuTest, DISABLED_BrowserAction) { |
92 extension_ = InstallExtension( | 95 extension_ = InstallExtension( |
93 test_data_dir_.AppendASCII("browsertest") | 96 test_data_dir_.AppendASCII("browsertest") |
94 .AppendASCII("browser_action_popup"), | 97 .AppendASCII("browser_action_popup"), |
95 1); | 98 1); |
96 EXPECT_TRUE(extension_); | 99 EXPECT_TRUE(extension_); |
97 extensions::ExtensionActionManager* action_manager = | 100 extensions::ExtensionActionManager* action_manager = |
98 extensions::ExtensionActionManager::Get(browser()->profile()); | 101 extensions::ExtensionActionManager::Get(browser()->profile()); |
99 action_ = action_manager->GetBrowserAction(*extension_); | 102 action_ = action_manager->GetBrowserAction(*extension_); |
100 EXPECT_TRUE(action_); | 103 EXPECT_TRUE(action_); |
101 | 104 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 to:[inspectItem target] | 140 to:[inspectItem target] |
138 from:inspectItem]; | 141 from:inspectItem]; |
139 devtools_attached_observer.Wait(); | 142 devtools_attached_observer.Wait(); |
140 | 143 |
141 // Hide the popup to prevent racy crashes at test cleanup. | 144 // Hide the popup to prevent racy crashes at test cleanup. |
142 BrowserActionTestUtil test_util(browser()); | 145 BrowserActionTestUtil test_util(browser()); |
143 test_util.HidePopup(); | 146 test_util.HidePopup(); |
144 | 147 |
145 service->SetBoolean(prefs::kExtensionsUIDeveloperMode, original); | 148 service->SetBoolean(prefs::kExtensionsUIDeveloperMode, original); |
146 } | 149 } |
OLD | NEW |