| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 """WebsiteTest testing class.""" | 5 """WebsiteTest testing class.""" |
| 6 | 6 |
| 7 import logging | 7 import logging |
| 8 import sys | 8 import sys |
| 9 import time | 9 import time |
| 10 | 10 |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 """Logs in and checks that the password is autofilled.""" | 287 """Logs in and checks that the password is autofilled.""" |
| 288 self.mode = self.Mode.AUTOFILLED | 288 self.mode = self.Mode.AUTOFILLED |
| 289 self.Login() | 289 self.Login() |
| 290 | 290 |
| 291 def LoginWhenNotAutofilled(self): | 291 def LoginWhenNotAutofilled(self): |
| 292 """Logs in and checks that the password is not autofilled.""" | 292 """Logs in and checks that the password is not autofilled.""" |
| 293 self.mode = self.Mode.NOT_AUTOFILLED | 293 self.mode = self.Mode.NOT_AUTOFILLED |
| 294 self.Login() | 294 self.Login() |
| 295 | 295 |
| 296 def Logout(self): | 296 def Logout(self): |
| 297 """Logout Method. Has to be overloaded by the Website test.""" | 297 """Logout Method.""" |
| 298 raise NotImplementedError("Logout is not implemented.") | 298 self.environment.ClearAllCookies() |
| 299 | 299 |
| 300 # Tests | 300 # Tests |
| 301 | 301 |
| 302 def WrongLoginTest(self): | 302 def WrongLoginTest(self): |
| 303 """Does the wrong login test: Tries to login with a wrong password and | 303 """Does the wrong login test: Tries to login with a wrong password and |
| 304 checks that the password is not saved. | 304 checks that the password is not saved. |
| 305 | 305 |
| 306 Raises: | 306 Raises: |
| 307 Exception: An exception is raised if the test fails: If there is a | 307 Exception: An exception is raised if the test fails: If there is a |
| 308 problem when performing the login (ex: the login button is not | 308 problem when performing the login (ex: the login button is not |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 402 | 402 |
| 403 self.LoginWhenNotAutofilled() | 403 self.LoginWhenNotAutofilled() |
| 404 self.Wait(2) | 404 self.Wait(2) |
| 405 self.environment.SwitchToInternals() | 405 self.environment.SwitchToInternals() |
| 406 self.environment.CheckForNewMessage( | 406 self.environment.CheckForNewMessage( |
| 407 environment.MESSAGE_ASK, | 407 environment.MESSAGE_ASK, |
| 408 True, | 408 True, |
| 409 "Error: password manager thinks that a login with wrong password was " | 409 "Error: password manager thinks that a login with wrong password was " |
| 410 "successful for the following website : %s \n" % self.name) | 410 "successful for the following website : %s \n" % self.name) |
| 411 self.environment.SwitchFromInternals() | 411 self.environment.SwitchFromInternals() |
| OLD | NEW |