#include "chrome/browser/extensions/extension_apitest.h"
#include "chrome/browser/extensions/lazy_background_page_test_util.h"
-#include "chrome/browser/notifications/desktop_notification_service.h"
-#include "chrome/browser/notifications/desktop_notification_service_factory.h"
+#include "chrome/browser/notifications/desktop_notification_profile_util.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "extensions/browser/process_manager.h"
#include "extensions/common/extension.h"
-#include "extensions/common/switches.h"
-#include "ui/message_center/message_center_switches.h"
-#include "ui/message_center/message_center_util.h"
class NotificationIdleTest : public ExtensionApiTest {
protected:
- virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
- ExtensionApiTest::SetUpCommandLine(command_line);
+ virtual void SetUpOnMainThread() OVERRIDE {
+ ExtensionApiTest::SetUpOnMainThread();
- command_line->AppendSwitchASCII(
- extensions::switches::kEventPageIdleTime, "1000");
- command_line->AppendSwitchASCII(
- extensions::switches::kEventPageSuspendingTime, "1000");
+ extensions::ProcessManager::SetEventPageIdleTimeForTesting(1);
+ extensions::ProcessManager::SetEventPageSuspendingTimeForTesting(1);
}
const extensions::Extension* LoadExtensionAndWait(
}
IN_PROC_BROWSER_TEST_F(ExtensionApiTest, NotificationsHasPermission) {
- DesktopNotificationServiceFactory::GetForProfile(browser()->profile())
- ->GrantPermission(GURL(
- "chrome-extension://peoadpeiejnhkmpaakpnompolbglelel"));
+ DesktopNotificationProfileUtil::GrantPermission(browser()->profile(),
+ GURL("chrome-extension://peoadpeiejnhkmpaakpnompolbglelel"));
+
ASSERT_TRUE(RunExtensionTest("notifications/has_permission_prefs"))
<< message_;
}