| 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 "base/utf_string_conversions.h" | 5 #include "base/utf_string_conversions.h" |
| 6 #include "chrome/browser/api/infobars/infobar_service.h" | 6 #include "chrome/browser/api/infobars/infobar_service.h" |
| 7 #include "chrome/browser/api/infobars/simple_alert_infobar_delegate.h" | 7 #include "chrome/browser/api/infobars/simple_alert_infobar_delegate.h" |
| 8 #include "chrome/browser/extensions/extension_apitest.h" | 8 #include "chrome/browser/extensions/extension_apitest.h" |
| 9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
| 10 #include "chrome/browser/ui/browser_tabstrip.h" | 10 #include "chrome/browser/ui/browser_tabstrip.h" |
| 11 #include "chrome/common/chrome_switches.h" | 11 #include "chrome/common/chrome_switches.h" |
| 12 | 12 |
| 13 // Times out on win asan, http://crbug.com/166026 | 13 // Times out on win asan, http://crbug.com/166026 |
| 14 #if defined(OS_WIN) && defined(ADDRESS_SANITIZER) | 14 #if defined(OS_WIN) && defined(ADDRESS_SANITIZER) |
| 15 #define MAYBE_GetAlertsForTab DISABLED_GetAlertsForTab | 15 #define MAYBE_GetAlertsForTab DISABLED_GetAlertsForTab |
| 16 #else | 16 #else |
| 17 #define MAYBE_GetAlertsForTab GetAlertsForTab | 17 #define MAYBE_GetAlertsForTab GetAlertsForTab |
| 18 #endif | 18 #endif |
| 19 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, MAYBE_GetAlertsForTab) { | 19 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, MAYBE_GetAlertsForTab) { |
| 20 content::WebContents* web_contents = chrome::GetActiveWebContents(browser()); | 20 content::WebContents* web_contents = chrome::GetActiveWebContents(browser()); |
| 21 ASSERT_TRUE(web_contents); | 21 ASSERT_TRUE(web_contents); |
| 22 InfoBarService* infobar_service = | 22 InfoBarService* infobar_service = |
| 23 InfoBarService::FromWebContents(web_contents); | 23 InfoBarService::FromWebContents(web_contents); |
| 24 ASSERT_TRUE(infobar_service); | 24 ASSERT_TRUE(infobar_service); |
| 25 | 25 |
| 26 const char kAlertMessage[] = "Simple Alert Infobar."; | 26 const char kAlertMessage[] = "Simple Alert Infobar."; |
| 27 infobar_service->AddInfoBar( | 27 SimpleAlertInfoBarDelegate::Create(infobar_service, |
| 28 new SimpleAlertInfoBarDelegate(infobar_service, | |
| 29 NULL, | 28 NULL, |
| 30 ASCIIToUTF16(kAlertMessage), | 29 ASCIIToUTF16(kAlertMessage), |
| 31 false)); | 30 false); |
| 32 CommandLine::ForCurrentProcess()->AppendSwitch( | 31 CommandLine::ForCurrentProcess()->AppendSwitch( |
| 33 switches::kEnableExperimentalExtensionApis); | 32 switches::kEnableExperimentalExtensionApis); |
| 34 ASSERT_TRUE(RunExtensionTest("accessibility/get_alerts_for_tab")) << message_; | 33 ASSERT_TRUE(RunExtensionTest("accessibility/get_alerts_for_tab")) << message_; |
| 35 } | 34 } |
| OLD | NEW |