Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(38)

Side by Side Diff: components/test/data/autofill/automated_integration/autofill_test/case.py

Issue 2116583004: Automated Autofill testing library + extension (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed indentation Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 # Copyright 2016 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 import sys
6 import unittest
7
8 from selenium.common.exceptions import TimeoutException
9
10 # Local Imports
11 from autofill_task.exceptions import ExpectationFailure
12 from .flow import AutofillTestFlow
13
14 class AutofillTestCase(unittest.TestCase):
15 """Wraps a single autofill test flow for use with the unittest library.
16
17 task_class: AutofillTask to use for the test.
18 profile: Dict of profile data that acts as the master source for
19 validating autofill behaviour.
20 debug: Whether debug output should be printed (False if not specified).
21 """
22 def __init__(self, task_class, user_data_dir, profile, chrome_binary=None,
23 debug=False):
24 super(AutofillTestCase, self).__init__('run')
25 self._flow = AutofillTestFlow(task_class, profile, debug=debug)
26 self._user_data_dir = user_data_dir
27 self._chrome_binary = chrome_binary
28 self._debug = debug
29
30 def __str__(self):
31 return str(self._flow)
32
33 def run(self, result):
34 result.startTest(self)
35
36 try:
37 self._flow.run(self._user_data_dir, chrome_binary=self._chrome_binary)
38 except KeyboardInterrupt:
39 raise
40 except (TimeoutException, ExpectationFailure):
41 result.addFailure(self, sys.exc_info())
42 except:
43 result.addError(self, sys.exc_info())
44 else:
45 result.addSuccess(self)
46 finally:
47 result.stopTest(self)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698