diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /dom/wifi/test/marionette/test_wifi_auto_connect.js | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'dom/wifi/test/marionette/test_wifi_auto_connect.js')
-rw-r--r-- | dom/wifi/test/marionette/test_wifi_auto_connect.js | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/dom/wifi/test/marionette/test_wifi_auto_connect.js b/dom/wifi/test/marionette/test_wifi_auto_connect.js new file mode 100644 index 000000000..7add9f03d --- /dev/null +++ b/dom/wifi/test/marionette/test_wifi_auto_connect.js @@ -0,0 +1,44 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +MARIONETTE_TIMEOUT = 60000; +MARIONETTE_HEAD_JS = 'head.js'; + +const TESTING_HOSTAPD = [{ ssid: 'ap0' }]; + +gTestSuite.doTestWithoutStockAp(function() { + let firstNetwork; + return gTestSuite.ensureWifiEnabled(true) + // Start custom hostapd for testing. + .then(() => gTestSuite.startHostapds(TESTING_HOSTAPD)) + .then(() => gTestSuite.verifyNumOfProcesses('hostapd', TESTING_HOSTAPD.length)) + + // Request the first scan. + .then(gTestSuite.requestWifiScan) + .then(function(networks) { + firstNetwork = networks[0]; + return gTestSuite.testAssociate(firstNetwork); + }) + + // Note that due to Bug 1168285, we need to re-start testing hostapd + // after wifi has been re-enabled. + + // Disable wifi and kill running hostapd. + .then(() => gTestSuite.requestWifiEnabled(false)) + .then(gTestSuite.killAllHostapd) + .then(() => gTestSuite.verifyNumOfProcesses('hostapd', 0)) + + // Re-enable wifi. + .then(() => gTestSuite.requestWifiEnabled(true)) + + // Restart hostapd. + .then(() => gTestSuite.startHostapds(TESTING_HOSTAPD)) + .then(() => gTestSuite.verifyNumOfProcesses('hostapd', TESTING_HOSTAPD.length)) + + // Wait for connection automatically. + .then(() => gTestSuite.waitForConnected(firstNetwork)) + + // Kill running hostapd. + .then(gTestSuite.killAllHostapd) + .then(() => gTestSuite.verifyNumOfProcesses('hostapd', 0)) +}); |