Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(233)

Unified Diff: functional/chromeos_wifi_functional.py

Issue 8586013: Added 4 new pyauto tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome/test/
Patch Set: '' Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: functional/chromeos_wifi_functional.py
===================================================================
--- functional/chromeos_wifi_functional.py (revision 110222)
+++ functional/chromeos_wifi_functional.py (working copy)
@@ -17,10 +17,10 @@
routers are attached.
"""
- def _LoginDevice(self):
+ def _LoginDevice(self, test_account='test_google_account'):
"""Logs into the device and cleans up flimflam profile."""
dennis_jeffrey 2011/11/17 02:38:25 Add an "Args:" section to this docstring that desc
deepakg 2011/11/17 23:21:15 Done.
if not self.GetLoginInfo()['is_logged_in']:
- credentials = self.GetPrivateInfo()['test_google_account']
+ credentials = self.GetPrivateInfo()[test_account]
self.Login(credentials['username'], credentials['password'])
login_info = self.GetLoginInfo()
self.assertTrue(login_info['is_logged_in'], msg='Login failed.')
@@ -96,6 +96,80 @@
self.assertFalse(service_path in self.GetNetworkInfo()['remembered_wifi'],
'Connected wifi was not removed from the remembered list.')
+ def testConnectToNonSharedOpenNetwork(self):
+ """Can connect to a shared open network and are connected to this
dennis_jeffrey 2011/11/17 02:38:25 'shared' --> 'non-shared'
deepakg 2011/11/17 23:21:15 Done.
+ even after logout.
dennis_jeffrey 2011/11/17 02:38:25 The first line of the docstring should be a 1-line
deepakg 2011/11/17 23:21:15 Done.
+ """
+ router_name = 'Trendnet_639gr_4'
+ self._LoginDevice()
+ router = self._SetupRouter(router_name)
+ error = self.ConnectToWifiRouter(router_name, shared=False)
+ self.assertFalse(error, msg='Failed to connect to wifi network %s. '
+ 'Reason: %s.' % (router['ssid'], error))
+ service_path = self.GetServicePath(router['ssid'])
+ self.assertTrue(service_path in self.GetNetworkInfo()['remembered_wifi'],
+ msg='Open wifi is not remembered for the current user.')
+ self.Logout()
+ for path in self.GetNetworkInfo()['wifi_networks']:
+ if path == service_path:
dennis_jeffrey 2011/11/17 02:38:25 If this condition is never true, the test will sti
deepakg 2011/11/17 23:21:15 Done.
+ self.assertTrue(self.GetNetworkInfo()['wifi_networks'][path]['status']
+ == 'Association', msg='We are not connected to the'
+ ' shared open network after logout.')
dennis_jeffrey 2011/11/17 02:38:25 I think it would be a little cleaner to indent lik
dennis_jeffrey 2011/11/17 02:38:25 'shared' --> 'non-shared'
deepakg 2011/11/17 23:21:15 This will push the characters beyond the 80 charac
deepakg 2011/11/17 23:21:15 Done.
+ break;
+ def testConnectToSharedOpenNetwork(self):
+ """Can connect to a shared open network and it is in the remembered
+ network list for all the users.
dennis_jeffrey 2011/11/17 02:38:25 The first line of the docstring should fit onto a
deepakg 2011/11/17 23:21:15 Done.
+ """
+ router_name = 'Trendnet_639gr_4'
+ self._LoginDevice()
+ router = self._SetupRouter(router_name)
+ error = self.ConnectToWifiRouter(router_name, shared=True)
+ self.assertFalse(error, msg='Failed to connect to wifi network %s. '
+ 'Reason: %s.' % (router['ssid'], error))
+ service_path = self.GetServicePath(router['ssid'])
+ self.assertTrue(service_path in self.GetNetworkInfo()['remembered_wifi'],
+ msg='Open Wifi is not remembered for the current user.')
+ self.Logout()
+ self._LoginDevice(test_account='test_google_account_2')
+ self.assertTrue(service_path in self.NetworkScan()['remembered_wifi'],
+ msg='Open network is not shared with other users.')
+
+ def testConnectToSharedHiddenNetwork(self):
+ """Can connect to shared hidden network and verify that its shared."""
dennis_jeffrey 2011/11/17 02:38:25 'its' --> 'it's'
deepakg 2011/11/17 23:21:15 Done.
+ router_name = "Netgear_WGR614"
+ self._LoginDevice()
+ router = self._SetupRouter(router_name)
+ error = self.ConnectToWifiRouter(router_name)
+ self.assertFalse(error, msg='Failed to connect to hidden network %s. '
+ 'Reason: %s.' % (router['ssid'], error))
+ service_path = self.GetServicePath(router['ssid'])
+ self.assertTrue(service_path in self.NetworkScan()['remembered_wifi'],
+ msg='Hidden network is not added to the remembered list.')
+ self.Logout()
+ self._LoginDevice(test_account='test_google_account_2')
+ self.assertTrue(service_path in self.NetworkScan()['remembered_wifi'],
+ msg='Shared Hidden network is not in other users '
dennis_jeffrey 2011/11/17 02:38:25 'users' --> 'user's'
deepakg 2011/11/17 23:21:15 Done.
+ 'remembered list.')
+
+ def testConnectToNonSharedHiddenNetwork(self):
+ """Can connect to a non-shared hidden network and
+ verify that its not shared.
dennis_jeffrey 2011/11/17 02:38:25 'its' --> 'it's'
dennis_jeffrey 2011/11/17 02:38:25 The first line of the docstring should fit onto a
deepakg 2011/11/17 23:21:15 Done.
deepakg 2011/11/17 23:21:15 Done.
+ """
+ router_name = "Linksys_WRT54GL"
+ self._LoginDevice()
+ router = self._SetupRouter(router_name)
+ error = self.ConnectToWifiRouter(router_name, shared=False)
+ self.assertFalse(error, msg='Failed to connect to hidden network %s. '
+ 'Reason: %s.' % (router['ssid'], error))
+ service_path = self.GetServicePath(router['ssid'])
+ self.assertTrue(service_path in self.NetworkScan()['remembered_wifi'],
+ msg='Hidden network is not added to the remembered list.')
+ self.Logout()
+ self._LoginDevice(test_account='test_google_account_2')
+ self.assertFalse(service_path in self.NetworkScan()['remembered_wifi'],
+ msg='Non-shared Hidden network is shared.')
+
+
if __name__ == '__main__':
pyauto_functional.Main()
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698