OLD | NEW |
---|---|
1 #!/usr/bin/python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 import pyauto_functional # pyauto_functional must come before pyauto. | 6 import pyauto_functional # pyauto_functional must come before pyauto. |
7 import pyauto | 7 import pyauto |
8 | 8 |
9 | 9 |
10 class ChromeosBrowserTest(pyauto.PyUITest): | 10 class ChromeosBrowserTest(pyauto.PyUITest): |
11 | 11 |
12 def testCloseAllTabs(self): | 12 def testCloseAllTabs(self): |
(...skipping 19 matching lines...) Expand all Loading... | |
32 | 32 |
33 self.CloseBrowserWindow(0) | 33 self.CloseBrowserWindow(0) |
34 info = self.GetBrowserInfo()['windows'] | 34 info = self.GetBrowserInfo()['windows'] |
35 self.assertEqual(1, len(info)) | 35 self.assertEqual(1, len(info)) |
36 url = info[0]['tabs'][0]['url'] | 36 url = info[0]['tabs'][0]['url'] |
37 self.assertEqual('chrome://newtab/', url, | 37 self.assertEqual('chrome://newtab/', url, |
38 msg='Unexpected URL: %s' % url) | 38 msg='Unexpected URL: %s' % url) |
39 self.assertTrue(info[0]['incognito'], | 39 self.assertTrue(info[0]['incognito'], |
40 msg='Incognito window is not displayed.') | 40 msg='Incognito window is not displayed.') |
41 | 41 |
42 def testCrashBrowser(self): | |
43 """Verify that after broswer crash is recovered, user can still navigate | |
44 to other URL. """ | |
45 crash_url = 'about:inducebrowsercrashforrealz' | |
46 self.NavigateToURL(crash_url) | |
47 self.NavigateToURL('http://www.google.com') | |
Nirnimesh
2012/04/18 23:21:54
I don't think this call will succeed. The pyauto c
Nirnimesh
2012/04/18 23:21:54
Do not use live URLs. Use one of the existing data
tturchetto
2012/04/23 21:29:39
Done.
tturchetto
2012/04/23 21:29:39
Done.
| |
48 self.assertEqual("Google", self.GetActiveTabTitle()) | |
49 | |
42 def testFullScreen(self): | 50 def testFullScreen(self): |
43 """Verify that a browser window can enter and exit full screen mode.""" | 51 """Verify that a browser window can enter and exit full screen mode.""" |
44 self.ApplyAccelerator(pyauto.IDC_FULLSCREEN) | 52 self.ApplyAccelerator(pyauto.IDC_FULLSCREEN) |
45 self.assertTrue(self.WaitUntil(lambda: | 53 self.assertTrue(self.WaitUntil(lambda: |
46 self.GetBrowserInfo()['windows'][0]['fullscreen']), | 54 self.GetBrowserInfo()['windows'][0]['fullscreen']), |
47 msg='Full Screen is not displayed.') | 55 msg='Full Screen is not displayed.') |
48 | 56 |
49 self.ApplyAccelerator(pyauto.IDC_FULLSCREEN) | 57 self.ApplyAccelerator(pyauto.IDC_FULLSCREEN) |
50 self.assertTrue(self.WaitUntil(lambda: not | 58 self.assertTrue(self.WaitUntil(lambda: not |
51 self.GetBrowserInfo()['windows'][0]['fullscreen']), | 59 self.GetBrowserInfo()['windows'][0]['fullscreen']), |
52 msg='Normal screen is not displayed.') | 60 msg='Normal screen is not displayed.') |
53 | 61 |
54 | 62 |
55 if __name__ == '__main__': | 63 if __name__ == '__main__': |
56 pyauto_functional.Main() | 64 pyauto_functional.Main() |
OLD | NEW |