blob: c5d3151b971430bea68d9799038fa41d03a50029 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/extensions/extension_apitest.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/infobars/simple_alert_infobar_delegate.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/chrome_switches.h"
// Times out on win asan, http://crbug.com/166026
#if defined(OS_WIN) && defined(ADDRESS_SANITIZER)
#define MAYBE_GetAlertsForTab DISABLED_GetAlertsForTab
#else
#define MAYBE_GetAlertsForTab GetAlertsForTab
#endif
IN_PROC_BROWSER_TEST_F(ExtensionApiTest, MAYBE_GetAlertsForTab) {
content::WebContents* web_contents =
browser()->tab_strip_model()->GetActiveWebContents();
ASSERT_TRUE(web_contents);
InfoBarService* infobar_service =
InfoBarService::FromWebContents(web_contents);
ASSERT_TRUE(infobar_service);
const char kAlertMessage[] = "Simple Alert Infobar.";
SimpleAlertInfoBarDelegate::Create(infobar_service,
InfoBarDelegate::kNoIconID,
ASCIIToUTF16(kAlertMessage),
false);
CommandLine::ForCurrentProcess()->AppendSwitch(
switches::kEnableExperimentalExtensionApis);
ASSERT_TRUE(RunExtensionTest("accessibility/get_alerts_for_tab")) << message_;
}
|