From 81fb050eab4fa0478b61097644c82b1ef21ea9d6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com>
Date: Thu, 29 Aug 2019 16:15:58 +0900
Subject: [PATCH] ui_test_core/selenium: undo patches on doType

This was for very old firefox and have been ineffective for years.

This reverts part of 2fcab04ecbb , which for some reason was patching
doType that was not used because defined in user-extensions.
---
 .../erp5_ui_test_core/user-extensions.js.js         | 13 -------------
 .../Zelenium/selenium/core/scripts/selenium-api.js  |  1 -
 2 files changed, 14 deletions(-)

diff --git a/bt5/erp5_ui_test_core/SkinTemplateItem/portal_skins/erp5_ui_test_core/user-extensions.js.js b/bt5/erp5_ui_test_core/SkinTemplateItem/portal_skins/erp5_ui_test_core/user-extensions.js.js
index ddda93f1ab..f3cdb929be 100644
--- a/bt5/erp5_ui_test_core/SkinTemplateItem/portal_skins/erp5_ui_test_core/user-extensions.js.js
+++ b/bt5/erp5_ui_test_core/SkinTemplateItem/portal_skins/erp5_ui_test_core/user-extensions.js.js
@@ -80,19 +80,6 @@ Selenium.prototype.assertPortalStatusMessage = function(text) {
     Assert.matches(text, actualValue);
 };
 
-Selenium.prototype.doType = function(locator, newText) {
-    if (typeof(netscape) != "undefined" && typeof(netscape.security.PrivilegeManager) != "undefined" ) {
-      // On old firefox versions, we enable privilege to upload file in javascript.
-      // The user needs to have signed.applets.codebase_principal_support set to true in about:config
-      // This is done in prefs.js generated by product/ERP5Type/tests/runFunctionalTest.py
-      // This approach no longer work in newer firefox versions https://developer.mozilla.org/en-US/docs/Bypassing_Security_Restrictions_and_Signing_Code
-      // Without this, tests dealing with file upload will fail
-      netscape.security.PrivilegeManager.enablePrivilege("UniversalFileRead");
-    }
-    var element = this.page().findElement(locator);
-    this.page().replaceText(element, newText);
-};
-
 /*
  * Get the location of the current page. This function is missing in
  * Selenium 0.8 or later.
diff --git a/product/Zelenium/selenium/core/scripts/selenium-api.js b/product/Zelenium/selenium/core/scripts/selenium-api.js
index 4b1719a930..c6c26d7339 100755
--- a/product/Zelenium/selenium/core/scripts/selenium-api.js
+++ b/product/Zelenium/selenium/core/scripts/selenium-api.js
@@ -741,7 +741,6 @@ Selenium.prototype.doType = function(locator, value) {
    * @param locator an <a href="#locators">element locator</a>
    * @param value the value to type
    */
-  netscape.security.PrivilegeManager.enablePrivilege("UniversalFileRead");
    if (this.browserbot.controlKeyDown || this.browserbot.altKeyDown || this.browserbot.metaKeyDown) {
         throw new SeleniumError("type not supported immediately after call to controlKeyDown() or altKeyDown() or metaKeyDown()");
     }
-- 
2.30.9