OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 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 os | 6 import os |
7 | 7 |
8 import pyauto_functional # Must be imported before pyauto | 8 import pyauto_functional # Must be imported before pyauto |
9 import pyauto | 9 import pyauto |
10 import test_utils | 10 import test_utils |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 ['Awesomeness']) | 51 ['Awesomeness']) |
52 test_utils.StringContentCheck(self, self.GetTabContents(1, 0), | 52 test_utils.StringContentCheck(self, self.GetTabContents(1, 0), |
53 ['Awesomeness'], | 53 ['Awesomeness'], |
54 ['page has no title']) | 54 ['page has no title']) |
55 | 55 |
56 def testThreeWindows(self): | 56 def testThreeWindows(self): |
57 """Test content when we have 3 windows.""" | 57 """Test content when we have 3 windows.""" |
58 self.NavigateToURL(self._DataDirURL('title1.html')) | 58 self.NavigateToURL(self._DataDirURL('title1.html')) |
59 for (window_index, url) in ((1, 'title2.html'), (2, 'title3.html')): | 59 for (window_index, url) in ((1, 'title2.html'), (2, 'title3.html')): |
60 self.OpenNewBrowserWindow(True) | 60 self.OpenNewBrowserWindow(True) |
61 self.GetBrowserWindow(window_index).BringToFront() | 61 self.BringBrowserToFront(window_index) |
62 self.NavigateToURL(self._DataDirURL(url), window_index, 0) | 62 self.NavigateToURL(self._DataDirURL(url), window_index, 0) |
63 | 63 |
64 test_utils.StringContentCheck(self, self.GetTabContents(0, 0), | 64 test_utils.StringContentCheck(self, self.GetTabContents(0, 0), |
65 ['page has no title'], | 65 ['page has no title'], |
66 ['Awesomeness']) | 66 ['Awesomeness']) |
67 test_utils.StringContentCheck(self, self.GetTabContents(0, 1), | 67 test_utils.StringContentCheck(self, self.GetTabContents(0, 1), |
68 ['Title Of Awesomeness'], | 68 ['Title Of Awesomeness'], |
69 ['page has no title']) | 69 ['page has no title']) |
70 test_utils.StringContentCheck(self, self.GetTabContents(0, 2), | 70 test_utils.StringContentCheck(self, self.GetTabContents(0, 2), |
71 ['Title Of More Awesomeness'], | 71 ['Title Of More Awesomeness'], |
(...skipping 15 matching lines...) Expand all Loading... |
87 self.assertTrue('Feeling Lucky' in html_regular) | 87 self.assertTrue('Feeling Lucky' in html_regular) |
88 self.RunCommand(pyauto.IDC_NEW_INCOGNITO_WINDOW) | 88 self.RunCommand(pyauto.IDC_NEW_INCOGNITO_WINDOW) |
89 self.NavigateToURL(url, 1, 0) | 89 self.NavigateToURL(url, 1, 0) |
90 html_incognito = self.GetTabContents(0, 1) | 90 html_incognito = self.GetTabContents(0, 1) |
91 self.assertTrue('Google Search' in html_incognito) | 91 self.assertTrue('Google Search' in html_incognito) |
92 self.assertTrue('Feeling Lucky' in html_incognito) | 92 self.assertTrue('Feeling Lucky' in html_incognito) |
93 | 93 |
94 | 94 |
95 if __name__ == '__main__': | 95 if __name__ == '__main__': |
96 pyauto_functional.Main() | 96 pyauto_functional.Main() |
OLD | NEW |