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 "build/build_config.h" | 5 #include "build/build_config.h" |
6 | 6 |
7 #if defined(TOOLKIT_GTK) | 7 #if defined(TOOLKIT_GTK) |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 L" if(document.body.bgColor == 'red'){" | 182 L" if(document.body.bgColor == 'red'){" |
183 L" window.domAutomationController.send(true)}}, 100)", | 183 L" window.domAutomationController.send(true)}}, 100)", |
184 &result); | 184 &result); |
185 ASSERT_TRUE(result); | 185 ASSERT_TRUE(result); |
186 } | 186 } |
187 | 187 |
188 IN_PROC_BROWSER_TEST_F(BrowserActionTest, DynamicBrowserAction) { | 188 IN_PROC_BROWSER_TEST_F(BrowserActionTest, DynamicBrowserAction) { |
189 ASSERT_TRUE(RunExtensionTest("browser_action_no_icon")) << message_; | 189 ASSERT_TRUE(RunExtensionTest("browser_action_no_icon")) << message_; |
190 | 190 |
191 // Test that there is a browser action in the toolbar and that it has no icon. | 191 // Test that there is a browser action in the toolbar and that it has no icon. |
192 ASSERT_EQ(1, NumberOfBrowserActions()); | 192 EXPECT_EQ(1, NumberOfBrowserActions()); |
193 EXPECT_TRUE(IsIconNull(0)); | 193 EXPECT_TRUE(IsIconNull(0)); |
194 | 194 |
195 // Tell the extension to update the icon using setIcon({imageData:...}). | 195 // Tell the extension to update the icon using setIcon({imageData:...}). |
196 ResultCatcher catcher; | 196 ResultCatcher catcher; |
197 ExtensionsService* service = browser()->profile()->GetExtensionsService(); | 197 ExtensionsService* service = browser()->profile()->GetExtensionsService(); |
198 Extension* extension = service->extensions()->at(0); | 198 Extension* extension = service->extensions()->at(0); |
199 ui_test_utils::NavigateToURL(browser(), | 199 ui_test_utils::NavigateToURL(browser(), |
200 GURL(extension->GetResourceURL("update.html"))); | 200 GURL(extension->GetResourceURL("update.html"))); |
201 ASSERT_TRUE(catcher.GetNextResult()); | 201 ASSERT_TRUE(catcher.GetNextResult()); |
202 | 202 |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 browser_actions->TestExecuteBrowserAction(0); | 293 browser_actions->TestExecuteBrowserAction(0); |
294 EXPECT_TRUE(browser_actions->TestGetPopup() != NULL); | 294 EXPECT_TRUE(browser_actions->TestGetPopup() != NULL); |
295 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | 295 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); |
296 bounds = browser_actions->TestGetPopup()->view()->bounds(); | 296 bounds = browser_actions->TestGetPopup()->view()->bounds(); |
297 EXPECT_EQ(width, bounds.width()); | 297 EXPECT_EQ(width, bounds.width()); |
298 EXPECT_EQ(height, bounds.height()); | 298 EXPECT_EQ(height, bounds.height()); |
299 browser_actions->HidePopup(); | 299 browser_actions->HidePopup(); |
300 EXPECT_TRUE(browser_actions->TestGetPopup() == NULL); | 300 EXPECT_TRUE(browser_actions->TestGetPopup() == NULL); |
301 } | 301 } |
302 #endif // defined(OS_WIN) | 302 #endif // defined(OS_WIN) |
OLD | NEW |