OLD | NEW |
| (Empty) |
1 #!/usr/bin/env python | |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
3 # Use of this source code is governed by a BSD-style license that can be | |
4 # found in the LICENSE file. | |
5 | |
6 import pyauto_functional | |
7 import pyauto | |
8 | |
9 | |
10 class TestOffline(pyauto.PyUITest): | |
11 """Tests the offline detection for ChromeOS.""" | |
12 | |
13 assert pyauto.PyUITest.IsChromeOS(), 'Works on ChromeOS only.' | |
14 | |
15 def tearDown(self): | |
16 self.RestoreOnline() | |
17 pyauto.PyUITest.tearDown(self) | |
18 | |
19 def testGoOffline(self): | |
20 """Tests the GoOffline pyauto method.""" | |
21 | |
22 self.GoOffline() | |
23 # Device takes a little bit of time to realize it's offline/online. | |
24 self.assertTrue(self.WaitUntil( | |
25 lambda: self.NetworkScan().get('offline_mode')), | |
26 msg='We are not offline.') | |
27 | |
28 | |
29 if __name__ == '__main__': | |
30 pyauto_functional.Main() | |
OLD | NEW |