From 6dd7de15843cb4f56a4465efe6d1ca10f3880bfe Mon Sep 17 00:00:00 2001 From: Thomas Walpole Date: Sun, 23 Jun 2019 10:50:44 -0700 Subject: [PATCH] [rb] Move common driver quit behavior to Common::Driver (#7318) --- rb/lib/selenium/webdriver/chrome/driver.rb | 6 ------ rb/lib/selenium/webdriver/common/driver.rb | 2 ++ rb/lib/selenium/webdriver/edge_html/driver.rb | 6 ------ rb/lib/selenium/webdriver/firefox/driver.rb | 6 ------ rb/lib/selenium/webdriver/ie/driver.rb | 6 ------ rb/lib/selenium/webdriver/safari/driver.rb | 6 ------ 6 files changed, 2 insertions(+), 30 deletions(-) diff --git a/rb/lib/selenium/webdriver/chrome/driver.rb b/rb/lib/selenium/webdriver/chrome/driver.rb index b7d7326a2aaeb..f79c811e7d174 100644 --- a/rb/lib/selenium/webdriver/chrome/driver.rb +++ b/rb/lib/selenium/webdriver/chrome/driver.rb @@ -52,12 +52,6 @@ def browser :chrome end - def quit - super - ensure - @service&.stop - end - def execute_cdp(cmd, **params) @bridge.send_command(cmd: cmd, params: params) end diff --git a/rb/lib/selenium/webdriver/common/driver.rb b/rb/lib/selenium/webdriver/common/driver.rb index 34d64c41657da..9e238a755510a 100644 --- a/rb/lib/selenium/webdriver/common/driver.rb +++ b/rb/lib/selenium/webdriver/common/driver.rb @@ -168,6 +168,8 @@ def page_source def quit bridge.quit + ensure + @service&.stop end # diff --git a/rb/lib/selenium/webdriver/edge_html/driver.rb b/rb/lib/selenium/webdriver/edge_html/driver.rb index f33d032c0b657..b92b4b9679aad 100644 --- a/rb/lib/selenium/webdriver/edge_html/driver.rb +++ b/rb/lib/selenium/webdriver/edge_html/driver.rb @@ -47,12 +47,6 @@ def initialize(opts = {}) def browser :edge end - - def quit - super - ensure - @service&.stop - end end # Driver end # Edge end # WebDriver diff --git a/rb/lib/selenium/webdriver/firefox/driver.rb b/rb/lib/selenium/webdriver/firefox/driver.rb index 5051f9dec553d..3b1ac0eb23472 100644 --- a/rb/lib/selenium/webdriver/firefox/driver.rb +++ b/rb/lib/selenium/webdriver/firefox/driver.rb @@ -49,12 +49,6 @@ def initialize(opts = {}) def browser :firefox end - - def quit - super - ensure - @service&.stop - end end # Driver end # Firefox end # WebDriver diff --git a/rb/lib/selenium/webdriver/ie/driver.rb b/rb/lib/selenium/webdriver/ie/driver.rb index d4e4b08b100cb..d7c47661c970c 100644 --- a/rb/lib/selenium/webdriver/ie/driver.rb +++ b/rb/lib/selenium/webdriver/ie/driver.rb @@ -48,12 +48,6 @@ def initialize(opts = {}) def browser :internet_explorer end - - def quit - super - ensure - @service&.stop - end end # Driver end # IE end # WebDriver diff --git a/rb/lib/selenium/webdriver/safari/driver.rb b/rb/lib/selenium/webdriver/safari/driver.rb index 7977b50070034..bc052f1113bec 100644 --- a/rb/lib/selenium/webdriver/safari/driver.rb +++ b/rb/lib/selenium/webdriver/safari/driver.rb @@ -49,12 +49,6 @@ def initialize(opts = {}) def browser :safari end - - def quit - super - ensure - @service&.stop - end end # Driver end # Safari end # WebDriver