| 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 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 service->extension_prefs()->SetIsIncognitoEnabled( | 334 service->extension_prefs()->SetIsIncognitoEnabled( |
| 335 service->extensions()->at(size_before)->id(), true); | 335 service->extensions()->at(size_before)->id(), true); |
| 336 service->extension_prefs()->SetIsIncognitoEnabled( | 336 service->extension_prefs()->SetIsIncognitoEnabled( |
| 337 service->extensions()->at(size_before + 2)->id(), true); | 337 service->extensions()->at(size_before + 2)->id(), true); |
| 338 | 338 |
| 339 Profile* incognito_profile = browser()->profile()->GetOffTheRecordProfile(); | 339 Profile* incognito_profile = browser()->profile()->GetOffTheRecordProfile(); |
| 340 Browser* incognito_browser = Browser::Create(incognito_profile); | 340 Browser* incognito_browser = Browser::Create(incognito_profile); |
| 341 BrowserActionTestUtil incognito_bar(incognito_browser); | 341 BrowserActionTestUtil incognito_bar(incognito_browser); |
| 342 | 342 |
| 343 // Navigate just to have a tab in this window, otherwise wonky things happen. | 343 // Navigate just to have a tab in this window, otherwise wonky things happen. |
| 344 ui_test_utils::OpenURLOffTheRecord(browser()->profile(), GURL("about:blank")); | 344 ui_test_utils::OpenURLOffTheRecord(browser()->profile(), |
| 345 GURL(chrome::kChromeUIExtensionsURL)); |
| 345 | 346 |
| 346 ASSERT_EQ(2, incognito_bar.NumberOfBrowserActions()); | 347 ASSERT_EQ(2, incognito_bar.NumberOfBrowserActions()); |
| 347 | 348 |
| 348 // Ensure that the browser actions are in the right order (ABC). | 349 // Ensure that the browser actions are in the right order (ABC). |
| 349 EXPECT_EQ(kTooltipA, GetBrowserActionsBar().GetTooltip(0)); | 350 EXPECT_EQ(kTooltipA, GetBrowserActionsBar().GetTooltip(0)); |
| 350 EXPECT_EQ(kTooltipB, GetBrowserActionsBar().GetTooltip(1)); | 351 EXPECT_EQ(kTooltipB, GetBrowserActionsBar().GetTooltip(1)); |
| 351 EXPECT_EQ(kTooltipC, GetBrowserActionsBar().GetTooltip(2)); | 352 EXPECT_EQ(kTooltipC, GetBrowserActionsBar().GetTooltip(2)); |
| 352 | 353 |
| 353 EXPECT_EQ(kTooltipA, incognito_bar.GetTooltip(0)); | 354 EXPECT_EQ(kTooltipA, incognito_bar.GetTooltip(0)); |
| 354 EXPECT_EQ(kTooltipC, incognito_bar.GetTooltip(1)); | 355 EXPECT_EQ(kTooltipC, incognito_bar.GetTooltip(1)); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 browser()->profile(), action->extension_id(), browser()); | 398 browser()->profile(), action->extension_id(), browser()); |
| 398 | 399 |
| 399 // It can take a moment for the background page to actually get destroyed | 400 // It can take a moment for the background page to actually get destroyed |
| 400 // so we wait for the notification before checking that it's really gone | 401 // so we wait for the notification before checking that it's really gone |
| 401 // and the badge text has been set. | 402 // and the badge text has been set. |
| 402 ui_test_utils::WaitForNotification( | 403 ui_test_utils::WaitForNotification( |
| 403 chrome::NOTIFICATION_EXTENSION_HOST_DESTROYED); | 404 chrome::NOTIFICATION_EXTENSION_HOST_DESTROYED); |
| 404 ASSERT_FALSE(manager->GetBackgroundHostForExtension(extension)); | 405 ASSERT_FALSE(manager->GetBackgroundHostForExtension(extension)); |
| 405 ASSERT_EQ("X", action->GetBadgeText(ExtensionAction::kDefaultTabId)); | 406 ASSERT_EQ("X", action->GetBadgeText(ExtensionAction::kDefaultTabId)); |
| 406 } | 407 } |
| OLD | NEW |