OLD | NEW |
1 # Copyright 2017 The Chromium Authors. All rights reserved. | 1 # Copyright 2017 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 from decorators import AndroidOnly | 5 from decorators import AndroidOnly |
6 from decorators import ChromeVersionAfterM | 6 from decorators import ChromeVersionEqualOrAfterM |
7 from decorators import ChromeVersionBeforeM | 7 from decorators import ChromeVersionBeforeM |
8 from common import ParseFlags | 8 from common import ParseFlags |
9 from common import IntegrationTest | 9 from common import IntegrationTest |
10 | 10 |
11 | 11 |
12 class DecoratorSmokeTest(IntegrationTest): | 12 class DecoratorSmokeTest(IntegrationTest): |
13 | 13 |
14 def AndroidOnlyFunction(self): | 14 def AndroidOnlyFunction(self): |
15 # This function should never be called. | 15 # This function should never be called. |
16 self.fail() | 16 self.fail() |
17 | 17 |
18 @AndroidOnly | 18 @AndroidOnly |
19 def testDecorator(self): | 19 def testDecorator(self): |
20 # This test should always result as 'skipped' or pass if --android given. | 20 # This test should always result as 'skipped' or pass if --android given. |
21 if not ParseFlags().android: | 21 if not ParseFlags().android: |
22 self.AndroidOnlyFunction() | 22 self.AndroidOnlyFunction() |
23 | 23 |
24 @ChromeVersionBeforeM(0) | 24 @ChromeVersionBeforeM(0) |
25 def testVersionBeforeDecorator(self): | 25 def testVersionBeforeDecorator(self): |
26 self.fail('This function should not be called when the Chrome Milestone is ' | 26 self.fail('This function should not be called when the Chrome Milestone is ' |
27 'greater than 0') | 27 'greater than 0') |
28 | 28 |
29 @ChromeVersionAfterM(999999999) | 29 @ChromeVersionEqualOrAfterM(999999999) |
30 def testVersionAfterDecorator(self): | 30 def testVersionAfterDecorator(self): |
31 self.fail('This function should not be called when the Chrome Milestone is ' | 31 self.fail('This function should not be called when the Chrome Milestone is ' |
32 'less than 999999999') | 32 'less than 999999999') |
33 | 33 |
34 if __name__ == '__main__': | 34 if __name__ == '__main__': |
35 IntegrationTest.RunAllTests() | 35 IntegrationTest.RunAllTests() |
OLD | NEW |