Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / extensions / notifications_apitest.cc
index 5d49953..b375141 100644 (file)
@@ -5,25 +5,19 @@
 #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);
+  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(
@@ -42,9 +36,9 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, NotificationsNoPermission) {
 }
 
 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_;
 }
@@ -62,7 +56,6 @@ IN_PROC_BROWSER_TEST_F(NotificationIdleTest, MAYBE_NotificationsAllowUnload) {
   ASSERT_TRUE(extension) << message_;
 
   // Lazy Background Page has been shut down.
-  extensions::ProcessManager* pm =
-      extensions::ExtensionSystem::Get(profile())->process_manager();
+  extensions::ProcessManager* pm = extensions::ProcessManager::Get(profile());
   EXPECT_FALSE(pm->GetBackgroundHostForExtension(last_loaded_extension_id()));
 }