| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2010 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2010 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 simplejson | 6 import simplejson |
| 7 import os | 7 import os |
| 8 | 8 |
| 9 import pyauto_functional | 9 import pyauto_functional |
| 10 import pyauto | 10 import pyauto |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 self.NavigateToURL(self.TEST_PAGE_URL, 1, 0) | 269 self.NavigateToURL(self.TEST_PAGE_URL, 1, 0) |
| 270 self.assertFalse(self._HasTable(windex=1)) | 270 self.assertFalse(self._HasTable(windex=1)) |
| 271 | 271 |
| 272 def testModificationsPersistAfterRendererCrash(self): | 272 def testModificationsPersistAfterRendererCrash(self): |
| 273 """Verify database modifications persist after crashing tab.""" | 273 """Verify database modifications persist after crashing tab.""" |
| 274 self.AppendTab(pyauto.GURL('about:blank')) | 274 self.AppendTab(pyauto.GURL('about:blank')) |
| 275 self.ActivateTab(0) | 275 self.ActivateTab(0) |
| 276 self.NavigateToURL(self.TEST_PAGE_URL) | 276 self.NavigateToURL(self.TEST_PAGE_URL) |
| 277 self._CreateTable() | 277 self._CreateTable() |
| 278 self._InsertRecord('1') | 278 self._InsertRecord('1') |
| 279 self.Kill(self.GetBrowserInfo()['windows'][0]['tabs'][0]['renderer_pid']) | 279 self.KillRendererProcess( |
| 280 self.GetBrowserInfo()['windows'][0]['tabs'][0]['renderer_pid']) |
| 280 self.ReloadActiveTab() | 281 self.ReloadActiveTab() |
| 281 self.assertEqual(['1'], self._GetRecords()) | 282 self.assertEqual(['1'], self._GetRecords()) |
| 282 | 283 |
| 283 def testIncognitoDBPersistentAcrossTabs(self): | 284 def testIncognitoDBPersistentAcrossTabs(self): |
| 284 """Test to check if database modifications are persistent across tabs | 285 """Test to check if database modifications are persistent across tabs |
| 285 in incognito window. | 286 in incognito window. |
| 286 """ | 287 """ |
| 287 self.RunCommand(pyauto.IDC_NEW_INCOGNITO_WINDOW) | 288 self.RunCommand(pyauto.IDC_NEW_INCOGNITO_WINDOW) |
| 288 self.NavigateToURL(self.TEST_PAGE_URL, 1, 0) | 289 self.NavigateToURL(self.TEST_PAGE_URL, 1, 0) |
| 289 self._CreateTable(windex=1) | 290 self._CreateTable(windex=1) |
| 290 self._InsertRecord('text', windex=1) | 291 self._InsertRecord('text', windex=1) |
| 291 self.AppendTab(pyauto.GURL(self.TEST_PAGE_URL), 1) | 292 self.AppendTab(pyauto.GURL(self.TEST_PAGE_URL), 1) |
| 292 self.assertEquals(['text'], self._GetRecords(1, 1)) | 293 self.assertEquals(['text'], self._GetRecords(1, 1)) |
| 293 | 294 |
| 294 | 295 |
| 295 if __name__ == '__main__': | 296 if __name__ == '__main__': |
| 296 pyauto_functional.Main() | 297 pyauto_functional.Main() |
| OLD | NEW |