OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 // TestShellPlatformDelegate isolates a variety of platform-specific | 5 // TestShellPlatformDelegate isolates a variety of platform-specific |
6 // functions so that code can invoke them by purpose without resorting to | 6 // functions so that code can invoke them by purpose without resorting to |
7 // ifdefs or runtime platform checks. Each platform should define an | 7 // ifdefs or runtime platform checks. Each platform should define an |
8 // implementation of this class. In many cases, implementation of methods | 8 // implementation of this class. In many cases, implementation of methods |
9 // in this class will be stubs on platforms where those functions are | 9 // in this class will be stubs on platforms where those functions are |
10 // unnecessary. | 10 // unnecessary. |
11 | 11 |
12 class TestShellPlatformDelegate { | 12 class TestShellPlatformDelegate { |
13 public: | 13 public: |
14 // The TestShellPlatformDelegate object is scoped to main(), and so | 14 // The TestShellPlatformDelegate object is scoped to main(), and so |
15 // its constructor is a good place to put per-application initialization | 15 // its constructor is a good place to put per-application initialization |
16 // (as opposed to per-test code, which should go into the TestShell class). | 16 // (as opposed to per-test code, which should go into the TestShell class). |
17 TestShellPlatformDelegate(const CommandLine& command_line); | 17 explicit TestShellPlatformDelegate(const CommandLine& command_line); |
18 ~TestShellPlatformDelegate(); | 18 ~TestShellPlatformDelegate(); |
19 | 19 |
20 // CheckLayoutTestSystemDependencies: check for any system dependencies that | 20 // CheckLayoutTestSystemDependencies: check for any system dependencies that |
21 // can't be easily overridden from within an application (for example, UI or | 21 // can't be easily overridden from within an application (for example, UI or |
22 // display settings). Returns false if any dependencies are not met. | 22 // display settings). Returns false if any dependencies are not met. |
23 bool CheckLayoutTestSystemDependencies(); | 23 bool CheckLayoutTestSystemDependencies(); |
24 | 24 |
25 // PreflightArgs: give the platform first crack at the arguments to main() | 25 // PreflightArgs: give the platform first crack at the arguments to main() |
26 // before we parse the command line. For example, some UI toolkits have | 26 // before we parse the command line. For example, some UI toolkits have |
27 // runtime flags that they can pre-filter. | 27 // runtime flags that they can pre-filter. |
(...skipping 17 matching lines...) Loading... |
45 // abort() (example: test timeouts). | 45 // abort() (example: test timeouts). |
46 void AboutToExit(); | 46 void AboutToExit(); |
47 | 47 |
48 // SetWindowPositionForRecording: if the platform's implementation of | 48 // SetWindowPositionForRecording: if the platform's implementation of |
49 // EventRecorder requires the window to be in a particular absolute position, | 49 // EventRecorder requires the window to be in a particular absolute position, |
50 // make it so. This is called by TestShell after it creates the window. | 50 // make it so. This is called by TestShell after it creates the window. |
51 void SetWindowPositionForRecording(TestShell *shell); | 51 void SetWindowPositionForRecording(TestShell *shell); |
52 private: | 52 private: |
53 const CommandLine& command_line_; | 53 const CommandLine& command_line_; |
54 }; | 54 }; |
OLD | NEW |