OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "chrome/browser/browser.h" | 5 #include "chrome/browser/browser.h" |
6 #include "chrome/browser/browser_window.h" | 6 #include "chrome/browser/browser_window.h" |
7 #include "chrome/browser/extensions/extension_apitest.h" | 7 #include "chrome/browser/extensions/extension_apitest.h" |
8 #include "chrome/browser/extensions/extension_browser_event_router.h" | 8 #include "chrome/browser/extensions/extension_browser_event_router.h" |
9 #include "chrome/browser/extensions/extension_tabs_module.h" | 9 #include "chrome/browser/extensions/extension_tabs_module.h" |
10 #include "chrome/browser/extensions/extensions_service.h" | 10 #include "chrome/browser/extensions/extensions_service.h" |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 ASSERT_EQ(L"Showing icon 2", text); | 133 ASSERT_EQ(L"Showing icon 2", text); |
134 | 134 |
135 // reload that tab, default title should come back | 135 // reload that tab, default title should come back |
136 ui_test_utils::NavigateToURL(browser(), GURL("about:blank")); | 136 ui_test_utils::NavigateToURL(browser(), GURL("about:blank")); |
137 ASSERT_TRUE( | 137 ASSERT_TRUE( |
138 browser_actions->GetBrowserActionViewAt(0)->button()->GetTooltipText( | 138 browser_actions->GetBrowserActionViewAt(0)->button()->GetTooltipText( |
139 0, 0, &text)); | 139 0, 0, &text)); |
140 ASSERT_EQ(L"hi!", text); | 140 ASSERT_EQ(L"hi!", text); |
141 } | 141 } |
142 | 142 |
143 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, BrowserActionPopup) { | 143 // This test is disabled. See bug 25746 |
| 144 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, DISABLED_BrowserActionPopup) { |
144 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("popup"))); | 145 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("popup"))); |
145 | 146 |
146 ResultCatcher catcher; | 147 ResultCatcher catcher; |
147 BrowserActionsContainer* browser_actions = | 148 BrowserActionsContainer* browser_actions = |
148 browser()->window()->GetBrowserWindowTesting()->GetToolbarView()-> | 149 browser()->window()->GetBrowserWindowTesting()->GetToolbarView()-> |
149 browser_actions(); | 150 browser_actions(); |
150 | 151 |
151 // Simulate a click on the browser action and verify the size of the resulting | 152 // Simulate a click on the browser action and verify the size of the resulting |
152 // popup. | 153 // popup. |
153 browser_actions->TestExecuteBrowserAction(0); | 154 browser_actions->TestExecuteBrowserAction(0); |
154 EXPECT_TRUE(browser_actions->TestGetPopup() != NULL); | 155 EXPECT_TRUE(browser_actions->TestGetPopup() != NULL); |
155 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | 156 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); |
156 gfx::Rect bounds = browser_actions->TestGetPopup()->view()->bounds(); | 157 gfx::Rect bounds = browser_actions->TestGetPopup()->view()->bounds(); |
157 EXPECT_EQ(100, bounds.width()); | 158 EXPECT_EQ(100, bounds.width()); |
158 EXPECT_EQ(100, bounds.height()); | 159 EXPECT_EQ(100, bounds.height()); |
159 browser_actions->HidePopup(); | 160 browser_actions->HidePopup(); |
160 EXPECT_TRUE(browser_actions->TestGetPopup() == NULL); | 161 EXPECT_TRUE(browser_actions->TestGetPopup() == NULL); |
161 | 162 |
162 // Do it again, and verify the new bigger size (the popup grows each time it's | 163 // Do it again, and verify the new bigger size (the popup grows each time it's |
163 // opened). | 164 // opened). |
164 browser_actions->TestExecuteBrowserAction(0); | 165 browser_actions->TestExecuteBrowserAction(0); |
165 EXPECT_TRUE(browser_actions->TestGetPopup() != NULL); | 166 EXPECT_TRUE(browser_actions->TestGetPopup() != NULL); |
166 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | 167 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); |
167 bounds = browser_actions->TestGetPopup()->view()->bounds(); | 168 bounds = browser_actions->TestGetPopup()->view()->bounds(); |
168 EXPECT_EQ(200, bounds.width()); | 169 EXPECT_EQ(200, bounds.width()); |
169 EXPECT_EQ(200, bounds.height()); | 170 EXPECT_EQ(200, bounds.height()); |
170 browser_actions->HidePopup(); | 171 browser_actions->HidePopup(); |
171 EXPECT_TRUE(browser_actions->TestGetPopup() == NULL); | 172 EXPECT_TRUE(browser_actions->TestGetPopup() == NULL); |
172 } | 173 } |
OLD | NEW |