OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 // Go back to first tab, changed title should reappear. | 143 // Go back to first tab, changed title should reappear. |
144 browser()->ActivateTabAt(0, true); | 144 browser()->ActivateTabAt(0, true); |
145 EXPECT_EQ("Showing icon 2", GetBrowserActionsBar().GetTooltip(0)); | 145 EXPECT_EQ("Showing icon 2", GetBrowserActionsBar().GetTooltip(0)); |
146 | 146 |
147 // Reload that tab, default title should come back. | 147 // Reload that tab, default title should come back. |
148 ui_test_utils::NavigateToURL(browser(), GURL("about:blank")); | 148 ui_test_utils::NavigateToURL(browser(), GURL("about:blank")); |
149 EXPECT_EQ("hi!", GetBrowserActionsBar().GetTooltip(0)); | 149 EXPECT_EQ("hi!", GetBrowserActionsBar().GetTooltip(0)); |
150 } | 150 } |
151 | 151 |
152 // http://code.google.com/p/chromium/issues/detail?id=70829 | 152 // http://code.google.com/p/chromium/issues/detail?id=70829 |
153 // Only mac is okay. | 153 // Mac used to be ok, but then mac 10.5 started failing too. =( |
154 #if !defined(OS_MACOSX) | 154 IN_PROC_BROWSER_TEST_F(BrowserActionApiTest, DISABLED_BrowserActionPopup) { |
155 #define MAYBE_BrowserActionPopup DISABLED_BrowserActionPopup | |
156 #else | |
157 #define MAYBE_BrowserActionPopup BrowserActionPopup | |
158 #endif | |
159 IN_PROC_BROWSER_TEST_F(BrowserActionApiTest, MAYBE_BrowserActionPopup) { | |
160 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII( | 155 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII( |
161 "browser_action/popup"))); | 156 "browser_action/popup"))); |
162 BrowserActionTestUtil actions_bar = GetBrowserActionsBar(); | 157 BrowserActionTestUtil actions_bar = GetBrowserActionsBar(); |
163 const Extension* extension = GetSingleLoadedExtension(); | 158 const Extension* extension = GetSingleLoadedExtension(); |
164 ASSERT_TRUE(extension) << message_; | 159 ASSERT_TRUE(extension) << message_; |
165 | 160 |
166 // The extension's popup's size grows by |growFactor| each click. | 161 // The extension's popup's size grows by |growFactor| each click. |
167 const int growFactor = 500; | 162 const int growFactor = 500; |
168 gfx::Size minSize = BrowserActionTestUtil::GetMinPopupSize(); | 163 gfx::Size minSize = BrowserActionTestUtil::GetMinPopupSize(); |
169 gfx::Size middleSize = gfx::Size(growFactor, growFactor); | 164 gfx::Size middleSize = gfx::Size(growFactor, growFactor); |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 BrowserActionExecuted( | 400 BrowserActionExecuted( |
406 browser()->profile(), action->extension_id(), browser()); | 401 browser()->profile(), action->extension_id(), browser()); |
407 | 402 |
408 // It can take a moment for the background page to actually get destroyed | 403 // It can take a moment for the background page to actually get destroyed |
409 // so we wait for the notification before checking that it's really gone | 404 // so we wait for the notification before checking that it's really gone |
410 // and the badge text has been set. | 405 // and the badge text has been set. |
411 host_destroyed_observer.Wait(); | 406 host_destroyed_observer.Wait(); |
412 ASSERT_FALSE(manager->GetBackgroundHostForExtension(extension->id())); | 407 ASSERT_FALSE(manager->GetBackgroundHostForExtension(extension->id())); |
413 ASSERT_EQ("X", action->GetBadgeText(ExtensionAction::kDefaultTabId)); | 408 ASSERT_EQ("X", action->GetBadgeText(ExtensionAction::kDefaultTabId)); |
414 } | 409 } |
OLD | NEW |