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