Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / extensions / api / management / management_api_browsertest.cc
index 76cc821..7f36d23 100644 (file)
@@ -2,12 +2,10 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "base/command_line.h"
 #include "base/files/file_path.h"
 #include "base/files/scoped_temp_dir.h"
 #include "base/strings/string_util.h"
 #include "base/strings/stringprintf.h"
-#include "chrome/browser/chrome_notification_types.h"
 #include "chrome/browser/extensions/api/management/management_api.h"
 #include "chrome/browser/extensions/api/management/management_api_constants.h"
 #include "chrome/browser/extensions/extension_browsertest.h"
@@ -16,7 +14,6 @@
 #include "chrome/browser/extensions/extension_test_message_listener.h"
 #include "chrome/browser/profiles/profile.h"
 #include "chrome/browser/ui/browser.h"
-#include "chrome/common/chrome_switches.h"
 #include "content/public/browser/notification_service.h"
 #include "content/public/common/url_constants.h"
 #include "content/public/test/browser_test_utils.h"
@@ -24,6 +21,7 @@
 #include "extensions/browser/extension_host.h"
 #include "extensions/browser/extension_prefs.h"
 #include "extensions/browser/extension_system.h"
+#include "extensions/browser/notification_types.h"
 
 namespace keys = extension_management_api_constants;
 namespace util = extension_function_test_utils;
@@ -290,8 +288,8 @@ IN_PROC_BROWSER_TEST_F(ExtensionManagementApiEscalationTest,
   SetEnabled(true, false, keys::kGestureNeededForEscalationError);
 
   // Expect an error that user cancelled the dialog.
-  CommandLine::ForCurrentProcess()->AppendSwitchASCII(
-      switches::kAppsGalleryInstallAutoConfirmForTests, "cancel");
+  ExtensionInstallPrompt::g_auto_confirm_for_tests =
+      ExtensionInstallPrompt::CANCEL;
   SetEnabled(true, true, keys::kUserDidNotReEnableError);
 
   // This should succeed when user accepts dialog.  We must wait for the process
@@ -299,10 +297,10 @@ IN_PROC_BROWSER_TEST_F(ExtensionManagementApiEscalationTest,
   // crash it.  (NOTIFICATION_RENDERER_PROCESS_CREATED does not wait for the
   // latter and can cause KillProcess to fail on Windows.)
   content::WindowedNotificationObserver observer(
-      chrome::NOTIFICATION_EXTENSION_HOST_CREATED,
+      extensions::NOTIFICATION_EXTENSION_HOST_CREATED,
       content::NotificationService::AllSources());
-  CommandLine::ForCurrentProcess()->AppendSwitchASCII(
-      switches::kAppsGalleryInstallAutoConfirmForTests, "accept");
+  ExtensionInstallPrompt::g_auto_confirm_for_tests =
+      ExtensionInstallPrompt::ACCEPT;
   SetEnabled(true, true, std::string());
   observer.Wait();