OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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 """PyAuto: Python Interface to Chromium's Automation Proxy. | 6 """PyAuto: Python Interface to Chromium's Automation Proxy. |
7 | 7 |
8 PyAuto uses swig to expose Automation Proxy interfaces to Python. | 8 PyAuto uses swig to expose Automation Proxy interfaces to Python. |
9 For complete documentation on the functionality available, | 9 For complete documentation on the functionality available, |
10 run pydoc on this file. | 10 run pydoc on this file. |
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
559 self.LaunchBrowserAndServer() | 559 self.LaunchBrowserAndServer() |
560 self.set_clear_profile(orig_clear_state) # Reset to original state. | 560 self.set_clear_profile(orig_clear_state) # Reset to original state. |
561 | 561 |
562 @staticmethod | 562 @staticmethod |
563 def DataDir(): | 563 def DataDir(): |
564 """Returns the path to the data dir chrome/test/data.""" | 564 """Returns the path to the data dir chrome/test/data.""" |
565 return os.path.normpath( | 565 return os.path.normpath( |
566 os.path.join(os.path.dirname(__file__), os.pardir, "data")) | 566 os.path.join(os.path.dirname(__file__), os.pardir, "data")) |
567 | 567 |
568 @staticmethod | 568 @staticmethod |
| 569 def ChromeOSDataDir(): |
| 570 """Returns the path to the data dir chromeos/test/data.""" |
| 571 return os.path.normpath( |
| 572 os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, os.pardir, |
| 573 "chromeos", "test", "data")) |
| 574 |
| 575 @staticmethod |
569 def GetFileURLForPath(*path): | 576 def GetFileURLForPath(*path): |
570 """Get file:// url for the given path. | 577 """Get file:// url for the given path. |
571 | 578 |
572 Also quotes the url using urllib.quote(). | 579 Also quotes the url using urllib.quote(). |
573 | 580 |
574 Args: | 581 Args: |
575 path: Variable number of strings that can be joined. | 582 path: Variable number of strings that can be joined. |
576 """ | 583 """ |
577 path_str = os.path.join(*path) | 584 path_str = os.path.join(*path) |
578 abs_path = os.path.abspath(path_str) | 585 abs_path = os.path.abspath(path_str) |
(...skipping 5911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6490 successful = result.wasSuccessful() | 6497 successful = result.wasSuccessful() |
6491 if not successful: | 6498 if not successful: |
6492 pyauto_tests_file = os.path.join(self.TestsDir(), self._tests_filename) | 6499 pyauto_tests_file = os.path.join(self.TestsDir(), self._tests_filename) |
6493 print >>sys.stderr, 'Tests can be disabled by editing %s. ' \ | 6500 print >>sys.stderr, 'Tests can be disabled by editing %s. ' \ |
6494 'Ref: %s' % (pyauto_tests_file, _PYAUTO_DOC_URL) | 6501 'Ref: %s' % (pyauto_tests_file, _PYAUTO_DOC_URL) |
6495 sys.exit(not successful) | 6502 sys.exit(not successful) |
6496 | 6503 |
6497 | 6504 |
6498 if __name__ == '__main__': | 6505 if __name__ == '__main__': |
6499 Main() | 6506 Main() |
OLD | NEW |