From 3c11127872ff5f49e76b8363c4fe87a964d7f6b8 Mon Sep 17 00:00:00 2001 From: Marco Castelluccio Date: Tue, 1 Oct 2019 04:28:06 +0000 Subject: [PATCH] Backed out 7 changesets (bug 1350887) for build bustage on a CLOSED TREE Backed out changeset d2b395e6c5c0 (bug 1350887) Backed out changeset 5a6d5c43135f (bug 1350887) Backed out changeset ec57676ad0d1 (bug 1350887) Backed out changeset 4a3d1a8767f7 (bug 1350887) Backed out changeset 40cd9ca1553e (bug 1350887) Backed out changeset d264991a436d (bug 1350887) Backed out changeset b915d40a6ba6 (bug 1350887) UltraBlame original commit: 9dfaf871831a944524df689ba9ef748699ff69c7 --- browser/installer/package-manifest.in | 32 - testing/marionette/README | 1054 ----------------- testing/marionette/components/marionette.js | 310 ++--- testing/marionette/moz.build | 14 +- .../{prefs/marionette.js => prefs.js} | 57 - testing/marionette/server.js | 19 - 6 files changed, 172 insertions(+), 1314 deletions(-) delete mode 100644 testing/marionette/README rename testing/marionette/{prefs/marionette.js => prefs.js} (74%) diff --git a/browser/installer/package-manifest.in b/browser/installer/package-manifest.in index aa0b5c7cfea9d..d57e132b60432 100644 --- a/browser/installer/package-manifest.in +++ b/browser/installer/package-manifest.in @@ -3985,38 +3985,6 @@ prefs . js ; -Remote -control -protocol -prefs -; -defined -in -. -. -/ -. -. -/ -testing -/ -marionette -/ -prefs -/ -marionette -. -js -RESPATH -/ -defaults -/ -prefs -/ -marionette -. -js -; Services ( gre diff --git a/testing/marionette/README b/testing/marionette/README deleted file mode 100644 index e46d8ce3ad7bc..0000000000000 --- a/testing/marionette/README +++ /dev/null @@ -1,1054 +0,0 @@ -MARIONETTE -Marionette -is -the -remote -protocol -that -lets -OOP -programs -communicate -with -instrument -and -control -Gecko -. -DESCRIPTION -Marionette -is -an -automation -driver -for -Mozilla -s -Gecko -engine -. -It -can -remotely -control -either -the -UI -or -the -internal -JavaScript -of -the -Gecko -platform -such -as -Firefox -. -It -can -control -both -the -chrome -and -the -content -document -giving -a -high -level -of -control -and -ability -to -replicate -user -interaction -. -In -addition -to -performing -actions -on -the -browser -Marionette -can -also -read -properties -and -attributes -of -the -DOM -. -USAGE -It -is -included -in -Firefox -but -not -enabled -by -default -unless -the -- -- -marionette -flag -is -passed -or -the -marionette -. -enabled -preference -is -set -to -true -. -To -start -Firefox -with -the -remote -protocol -turned -on -: -% -firefox -- -- -marionette -1491228343089 -Marionette -INFO -Listening -on -port -2828 -This -binds -to -a -TCP -socket -over -which -CLIENTS -can -communicate -with -Marionette -using -the -PROTOCOL -. -PROTOCOL -Marionette -provides -an -asynchronous -parallel -pipelining -user -- -facing -interface -. -Message -sequencing -limits -chances -of -payload -race -conditions -and -provides -a -uniform -way -in -which -payloads -are -serialised -. -Clients -that -deliver -a -blocking -WebDriver -interface -are -still -expected -to -not -send -further -command -requests -before -the -response -from -the -last -command -has -come -back -but -if -they -still -happen -to -do -so -because -of -programming -error -no -harm -will -be -done -. -This -guards -against -bugs -such -as -https -: -/ -/ -bugzil -. -la -/ -1207125 -. -Schematic -flow -of -messages -: -client -server -| -| -msgid -= -1 -| -- -- -- -- -- -- -- -- -- -- -- -> -| -| -command -| -| -| -msgid -= -2 -| -< -- -- -- -- -- -- -- -- -- -- -- -| -| -command -| -| -| -msgid -= -2 -| -- -- -- -- -- -- -- -- -- -- -- -> -| -| -response -| -| -| -msgid -= -1 -| -< -- -- -- -- -- -- -- -- -- -- -- -| -| -response -| -| -| -The -protocol -consists -of -a -COMMAND -message -and -the -corresponding -RESPONSE -message -. -A -RESPONSE -message -must -always -be -sent -in -reply -to -a -COMMAND -message -. -This -means -that -the -server -implementation -does -not -need -to -send -the -reply -precisely -in -the -order -of -the -received -commands -: -if -it -receives -multiple -messages -the -server -may -even -reply -in -random -order -. -It -is -therefore -strongly -adviced -that -clients -take -this -into -account -when -implementing -the -client -end -of -this -wire -protocol -. -This -is -required -for -pipelining -messages -. -On -the -server -side -some -functions -are -fast -and -some -less -so -. -If -the -server -must -reply -in -order -the -slow -functions -delay -the -other -replies -even -if -its -execution -is -already -completed -. -COMMAND -The -request -or -command -message -is -a -four -element -JSON -array -as -shown -below -that -may -originate -from -either -the -client -- -or -server -remote -ends -: -[ -type -message -ID -command -parameters -] -type -Must -be -0 -( -integer -) -. -This -indicates -that -the -message -is -the -COMMAND -message -. -message -ID -A -32 -- -bit -unsigned -integer -. -This -number -is -used -as -sequencing -number -that -uniquely -identifies -a -pair -of -COMMAND -and -RESPONSE -messages -. -The -other -remote -part -will -reply -with -a -corresponding -RESPONSE -with -the -same -message -ID -. -command -A -string -identifying -the -RPC -method -or -command -to -execute -. -parameters -An -arbitrary -JSON -serialisable -object -. -RESPONSE -The -response -message -is -also -a -four -element -array -as -shown -below -and -must -always -be -sent -after -receiving -a -COMMAND -: -[ -type -message -ID -error -result -] -type -Must -be -1 -( -integer -) -. -This -indicates -that -the -message -is -the -RESPONSE -message -. -message -ID -A -32 -- -bit -unsigned -integer -. -This -corresponds -to -the -COMMAND -message -s -message -ID -. -error -If -the -command -executed -correctly -this -field -is -null -. -If -the -error -occurre -on -the -server -- -side -then -this -field -is -an -ERROR -object -. -result -The -result -object -associated -with -the -COMMAND -if -it -executed -correctly -. -If -an -error -occurred -on -the -server -- -side -this -field -is -null -. -The -structure -of -the -result -entry -can -vary -but -is -documented -individually -for -each -command -in -. -/ -driver -. -js -. -ERROR -OBJECTS -An -ERROR -object -is -a -serialisation -of -JavaScript -error -types -and -is -structured -like -this -: -{ -" -error -" -: -" -invalid -session -id -" -" -message -" -: -" -No -active -session -with -ID -1234 -" -" -stacktrace -" -: -" -" -} -All -the -fields -of -the -error -object -are -required -so -the -stacktrace -and -message -fields -may -be -empty -strings -. -The -error -field -is -on -the -other -hand -guaranteed -to -be -one -of -the -JSON -error -codes -as -laid -out -by -the -WebDriver -standard -: -https -: -/ -/ -w3c -. -github -. -io -/ -webdriver -/ -webdriver -- -spec -. -html -# -handling -- -errors -CLIENTS -Clients -may -be -implemented -in -any -language -that -is -capable -of -writing -and -receiving -data -over -TCP -socket -. -A -reference -client -is -provided -in -tree -( -under -. -/ -client -) -. -Clients -may -be -implemented -both -synchronously -and -asynchronously -although -the -latter -is -impossible -in -protocol -levels -2 -and -earlier -due -to -the -lack -of -message -indexing -. -DOCUMENTATION -General -introduction -: -https -: -/ -/ -developer -. -mozilla -. -org -/ -en -- -US -/ -docs -/ -Mozilla -/ -QA -/ -Marionette -Protocol -definition -: -https -: -/ -/ -developer -. -mozilla -. -org -/ -en -- -US -/ -docs -/ -Mozilla -/ -QA -/ -Marionette -/ -Protocol -Generated -Python -client -API -documentation -: -https -: -/ -/ -marionette -- -client -. -readthedocs -. -org -/ -BUGS -Server -and -Python -client -bugs -are -tracked -in -the -Testing -: -: -Marionette -component -in -Bugzilla -: -https -: -/ -/ -bugzilla -. -mozilla -. -org -/ -buglist -. -cgi -? -product -= -Testing -& -component -= -Marionette -geckodriver -( -found -in -. -. -/ -geckodriver -) -the -HTTP -proxy -for -using -W3C -WebDriver -- -compatible -clients -with -Marionette -tracks -its -bugs -on -GitHub -: -https -: -/ -/ -github -. -com -/ -mozilla -/ -geckodriver -/ -issues diff --git a/testing/marionette/components/marionette.js b/testing/marionette/components/marionette.js index e2b78a9dbd3a7..ac23345f5933f 100644 --- a/testing/marionette/components/marionette.js +++ b/testing/marionette/components/marionette.js @@ -286,15 +286,7 @@ const LOG_LEVELS = new -class -extends Map -{ -constructor -( -) -{ -super ( [ [ @@ -370,51 +362,6 @@ Trace ] ) ; -} -get -( -level -) -{ -let -s -= -new -String -( -level -) -. -toLowerCase -( -) -; -if -( -! -this -. -has -( -s -) -) -{ -return -DEFAULT_LOG_LEVEL -; -} -return -super -. -get -( -s -) -; -} -} -; / / Besides @@ -596,88 +543,6 @@ initSpecialConnection ; / / -Get -preference -value -of -| -preferred -| -falling -back -to -| -fallback -| -/ -/ -if -| -preferred -| -is -not -user -- -modified -and -| -fallback -| -exists -. -function -getPref -( -preferred -fallback -) -{ -if -( -! -Preferences -. -isSet -( -preferred -) -& -& -Preferences -. -has -( -fallback -) -) -{ -return -Preferences -. -get -( -fallback -Preferences -. -get -( -preferred -) -) -; -} -return -Preferences -. -get -( -preferred -) -; -} -/ -/ Marionette preferences recently @@ -737,11 +602,24 @@ port ( ) { +let +fallback += +Preferences +. +get +( +PREF_PORT_FALLBACK +DEFAULT_PORT +) +; return -getPref +Preferences +. +get ( PREF_PORT -PREF_PORT_FALLBACK +fallback ) ; } @@ -751,15 +629,70 @@ logLevel ) { let -s +level += +DEFAULT_LOG_LEVEL +; +let +fallback = -getPref +Preferences +. +get ( -PREF_LOG_LEVEL PREF_LOG_LEVEL_FALLBACK +level ) ; -return +let +p += +Preferences +. +get +( +PREF_LOG_LEVEL +fallback +) +; +switch +( +typeof +p +) +{ +/ +/ +Gecko +> += +46 +case +" +string +" +: +let +s += +p +. +toLowerCase +( +) +; +if +( +LOG_LEVELS +. +has +( +s +) +) +{ +level += LOG_LEVELS . get @@ -768,16 +701,63 @@ s ) ; } +break +; +/ +/ +Gecko +< += +45 +case +" +boolean +" +: +if +( +p +) +{ +level += +Log +. +Level +. +Trace +; +} +break +; +} +return +level +; +} get forceLocal ( ) { +let +fallback += +Preferences +. +get +( +PREF_FORCE_LOCAL_FALLBACK +true +) +; return -getPref +Preferences +. +get ( PREF_FORCE_LOCAL -PREF_FORCE_LOCAL_FALLBACK +fallback ) ; } @@ -2016,7 +1996,7 @@ insaneSacrificialGoat new ServerSocket ( -0 +666 Ci . nsIServerSocket @@ -2095,6 +2075,48 @@ port ) ; } +catch +( +e +) +{ +this +. +logger +. +error +( +Error +on +starting +server +: +{ +e +} +) +; +dump +( +{ +e +. +toString +( +) +} +\ +n +{ +e +. +stack +} +\ +n +) +; +} finally { if diff --git a/testing/marionette/moz.build b/testing/marionette/moz.build index ded78159a46d6..c31fc90b4a908 100644 --- a/testing/marionette/moz.build +++ b/testing/marionette/moz.build @@ -61,26 +61,24 @@ DIRS components " ] -JAR_MANIFESTS +JS_PREFERENCE_FILES + = [ " -jar +prefs . -mn +js " ] -JS_PREFERENCE_FILES +JAR_MANIFESTS + = [ " -prefs -/ -marionette +jar . -js +mn " ] MARIONETTE_UNIT_MANIFESTS diff --git a/testing/marionette/prefs/marionette.js b/testing/marionette/prefs.js similarity index 74% rename from testing/marionette/prefs/marionette.js rename to testing/marionette/prefs.js index 0c4d2fae302f1..526e6631181f0 100644 --- a/testing/marionette/prefs/marionette.js +++ b/testing/marionette/prefs.js @@ -58,63 +58,6 @@ MPL / / / -Marionette -is -the -remote -protocol -that -lets -OOP -programs -communicate -/ -/ -with -instrument -and -control -Gecko -. -/ -/ -/ -/ -It -is -included -in -Firefox -but -not -enabled -by -default -unless -the -/ -/ -- -- -marionette -flag -is -passed -or -the -marionette -. -enabled -preference -is -/ -/ -set -to -true -. -/ -/ Whether or not diff --git a/testing/marionette/server.js b/testing/marionette/server.js index 197524c5f3615..014f425369f62 100644 --- a/testing/marionette/server.js +++ b/testing/marionette/server.js @@ -2520,25 +2520,6 @@ nsIServerSocket LoopbackOnly ; } -else -{ -logger -. -warn -( -" -Server -socket -is -not -limited -to -loopback -connections -" -) -; -} this . listener