• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
3 // found in the LICENSE file.
4 
5 #include "chrome/browser/extensions/extension_apitest.h"
6 
7 #include "chrome/browser/notifications/desktop_notification_service.h"
8 #include "chrome/browser/notifications/desktop_notification_service_factory.h"
9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/ui/browser.h"
11 
12 // Flaky, http://crbug.com/42314.
IN_PROC_BROWSER_TEST_F(ExtensionApiTest,FLAKY_Notifications)13 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, FLAKY_Notifications) {
14 #if defined(OS_LINUX) && defined(TOOLKIT_VIEWS)
15   // Notifications not supported on linux/views yet.
16 #else
17   ASSERT_TRUE(RunExtensionTest("notifications/has_not_permission")) << message_;
18   ASSERT_TRUE(RunExtensionTest("notifications/has_permission_manifest"))
19       << message_;
20   DesktopNotificationServiceFactory::GetForProfile(browser()->profile())
21       ->GrantPermission(GURL(
22           "chrome-extension://peoadpeiejnhkmpaakpnompolbglelel"));
23   ASSERT_TRUE(RunExtensionTest("notifications/has_permission_prefs"))
24       << message_;
25 #endif
26 }
27