18238fdcf89535456a0be158a4f267611ae8b152aKris Rambish# Copyright (c) 2013 The Chromium Authors. All rights reserved. 28238fdcf89535456a0be158a4f267611ae8b152aKris Rambish# Use of this source code is governed by a BSD-style license that can be 38238fdcf89535456a0be158a4f267611ae8b152aKris Rambish# found in the LICENSE file. 48238fdcf89535456a0be158a4f267611ae8b152aKris Rambish 58238fdcf89535456a0be158a4f267611ae8b152aKris Rambishimport netgear_single_band_configurator 68238fdcf89535456a0be158a4f267611ae8b152aKris Rambishfrom netgear_single_band_configurator import * 78238fdcf89535456a0be158a4f267611ae8b152aKris Rambish 8d751a4f5e86c0e5f8a984d7fe21a4f74c7caa761Kris Rambishimport ap_spec 98238fdcf89535456a0be158a4f267611ae8b152aKris Rambish 108238fdcf89535456a0be158a4f267611ae8b152aKris Rambishclass Netgear1000APConfigurator(netgear_single_band_configurator. 118238fdcf89535456a0be158a4f267611ae8b152aKris Rambish NetgearSingleBandAPConfigurator): 128238fdcf89535456a0be158a4f267611ae8b152aKris Rambish """Derived class to control Netgear WNR1000v3 router.""" 138238fdcf89535456a0be158a4f267611ae8b152aKris Rambish 148238fdcf89535456a0be158a4f267611ae8b152aKris Rambish 158238fdcf89535456a0be158a4f267611ae8b152aKris Rambish def set_mode(self, mode): 168238fdcf89535456a0be158a4f267611ae8b152aKris Rambish # The mode popup changes based on the security mode. Set to no 178238fdcf89535456a0be158a4f267611ae8b152aKris Rambish # security to get the right popup. 188238fdcf89535456a0be158a4f267611ae8b152aKris Rambish self.add_item_to_command_list(self._set_security_disabled, (), 1, 799) 198238fdcf89535456a0be158a4f267611ae8b152aKris Rambish self.add_item_to_command_list(self._set_mode, (mode, ), 1, 800) 208238fdcf89535456a0be158a4f267611ae8b152aKris Rambish 218238fdcf89535456a0be158a4f267611ae8b152aKris Rambish 228238fdcf89535456a0be158a4f267611ae8b152aKris Rambish def _set_mode(self, mode): 23d751a4f5e86c0e5f8a984d7fe21a4f74c7caa761Kris Rambish if mode == ap_spec.MODE_G: 248238fdcf89535456a0be158a4f267611ae8b152aKris Rambish mode = 'Up to 54 Mbps' 25d751a4f5e86c0e5f8a984d7fe21a4f74c7caa761Kris Rambish elif mode == ap_spec.MODE_N: 268238fdcf89535456a0be158a4f267611ae8b152aKris Rambish mode = 'Up to 150 Mbps' 278238fdcf89535456a0be158a4f267611ae8b152aKris Rambish else: 288238fdcf89535456a0be158a4f267611ae8b152aKris Rambish raise RuntimeError('Unsupported mode passed.') 298238fdcf89535456a0be158a4f267611ae8b152aKris Rambish xpath = '//select[@name="opmode"]' 308238fdcf89535456a0be158a4f267611ae8b152aKris Rambish self.select_item_from_popup_by_xpath(mode, xpath) 31