diff options
author | dtu@chromium.org <dtu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-06 22:07:15 +0000 |
---|---|---|
committer | dtu@chromium.org <dtu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-06 22:07:15 +0000 |
commit | 2831638398f9ab2b991009c1e380395758c98e60 (patch) | |
tree | 327d974ef60426b8182c52e3d434b5e34b89bf4a /chrome/test/functional | |
parent | 9cb31511cb8ba57c36157c5a509ffd3fe4568437 (diff) | |
download | chromium_src-2831638398f9ab2b991009c1e380395758c98e60.zip chromium_src-2831638398f9ab2b991009c1e380395758c98e60.tar.gz chromium_src-2831638398f9ab2b991009c1e380395758c98e60.tar.bz2 |
Initial inclusion of power_strip code.
Including WifiRouterStrip code that is used for power_strips that exclusively have Wifi routers attached to them.
Added first connect test case using the power strip.
BUG=
TEST=run chromeos_wifi.py
Review URL: http://codereview.chromium.org/6764022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80704 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/functional')
-rw-r--r-- | chrome/test/functional/chromeos_wifi.py | 10 | ||||
-rw-r--r-- | chrome/test/functional/chromeos_wifi_compliance.py | 53 |
2 files changed, 56 insertions, 7 deletions
diff --git a/chrome/test/functional/chromeos_wifi.py b/chrome/test/functional/chromeos_wifi.py index 0019003..131f4a6 100644 --- a/chrome/test/functional/chromeos_wifi.py +++ b/chrome/test/functional/chromeos_wifi.py @@ -12,22 +12,18 @@ import chromeos_network # pyauto_functional must come before chromeos_network class ChromeosWifi(chromeos_network.PyNetworkUITest): """Tests for ChromeOS wifi.""" - def testNetworkInfo(self): + def testNetworkInfoAndScan(self): """Get basic info on networks.""" - result = self.GetNetworkInfo() + # NetworkScan will also call GetNetworkInfo and return the results. + result = self.NetworkScan() self.assertTrue(result) logging.debug(result) - def testNetworkScan(self): - """Basic check to ensure that a network scan doesn't throw errors.""" - self.NetworkScan() - def testGetProxySettings(self): """Print some information about proxy settings.""" result = self.GetProxySettingsOnChromeOS() self.assertTrue(result) logging.debug(result) - if __name__ == '__main__': pyauto_functional.Main() diff --git a/chrome/test/functional/chromeos_wifi_compliance.py b/chrome/test/functional/chromeos_wifi_compliance.py new file mode 100644 index 0000000..b66be87 --- /dev/null +++ b/chrome/test/functional/chromeos_wifi_compliance.py @@ -0,0 +1,53 @@ +#!/usr/bin/python +# Copyright (c) 2011 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import pyauto_functional +import chromeos_network # pyauto_functional must come before chromeos_network + + +class ChromeosWifiCompliance(chromeos_network.PyNetworkUITest): + """Tests for ChromeOS wifi complaince. + + These tests should be run within vacinity of the power strip where the wifi + routers are attached. + """ + + def _BasicConnectRouterCompliance(self, router_name): + """Generic basic test routine for connecting to a router. + + Args: + router_name: The name of the router. + """ + self.InitWifiPowerStrip() + router = self.GetRouterConfig(router_name) + self.RouterPower(router_name, True) + + self.assertTrue(self.WaitUntilWifiNetworkAvailable(router['ssid']), + 'Wifi network %s never showed up.' % router['ssid']) + + # Verify connect did not have any errors. + error = self.ConnectToWifiRouter(router_name) + self.assertFalse(error, 'Failed to connect to wifi network %s. ' + 'Reason: %s.' % (router['ssid'], error)) + + # Verify the network we connected to. + ssid = self.GetConnectedWifi() + self.assertEqual(ssid, router['ssid'], + 'Did not successfully connect to wifi network %s.' % ssid) + + self.DisconnectFromWifiNetwork() + self.RouterPower(router_name, False) + + def testConnectBelkinG(self): + """Test connecting to the Belkin G router.""" + self._BasicConnectRouterCompliance('Belkin_G') + + def testConnectLinksysWRT54G2(self): + """Test connecting to the Linksys WRT54G2 router.""" + self._BasicConnectRouterCompliance('Linksys_WRT54G2') + + +if __name__ == '__main__': + pyauto_functional.Main() |