| 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_tab_helper.h" | 7 #include "chrome/browser/infobars/infobar_tab_helper.h" |
| 8 #include "chrome/browser/tab_contents/simple_alert_infobar_delegate.h" | 8 #include "chrome/browser/tab_contents/simple_alert_infobar_delegate.h" |
| 9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
| 10 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 10 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
| 11 #include "chrome/common/chrome_switches.h" | 11 #include "chrome/common/chrome_switches.h" |
| 12 | 12 |
| 13 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, GetAlertsForTab) { | 13 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, GetAlertsForTab) { |
| 14 TabContentsWrapper* tab = browser()->GetSelectedTabContentsWrapper(); | 14 TabContents* tab = browser()->GetActiveTabContents(); |
| 15 ASSERT_TRUE(tab); | 15 ASSERT_TRUE(tab); |
| 16 InfoBarTabHelper* infobar_helper = tab->infobar_tab_helper(); | 16 InfoBarTabHelper* infobar_helper = tab->infobar_tab_helper(); |
| 17 | 17 |
| 18 const char kAlertMessage[] = "Simple Alert Infobar."; | 18 const char kAlertMessage[] = "Simple Alert Infobar."; |
| 19 infobar_helper->AddInfoBar( | 19 infobar_helper->AddInfoBar( |
| 20 new SimpleAlertInfoBarDelegate(infobar_helper, | 20 new SimpleAlertInfoBarDelegate(infobar_helper, |
| 21 NULL, | 21 NULL, |
| 22 ASCIIToUTF16(kAlertMessage), | 22 ASCIIToUTF16(kAlertMessage), |
| 23 false)); | 23 false)); |
| 24 CommandLine::ForCurrentProcess()->AppendSwitch( | 24 CommandLine::ForCurrentProcess()->AppendSwitch( |
| 25 switches::kEnableExperimentalExtensionApis); | 25 switches::kEnableExperimentalExtensionApis); |
| 26 ASSERT_TRUE(RunExtensionTest("accessibility/get_alerts_for_tab")) << message_; | 26 ASSERT_TRUE(RunExtensionTest("accessibility/get_alerts_for_tab")) << message_; |
| 27 } | 27 } |
| OLD | NEW |