| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 // TestShellPlatformDelegate isolates a variety of platform-specific | |
| 6 // functions so that code can invoke them by purpose without resorting to | |
| 7 // ifdefs or runtime platform checks. Each platform should define an | |
| 8 // implementation of this class. In many cases, implementation of methods | |
| 9 // in this class will be stubs on platforms where those functions are | |
| 10 // unnecessary. | |
| 11 | |
| 12 class TestShellPlatformDelegate { | |
| 13 public: | |
| 14 // The TestShellPlatformDelegate object is scoped to main(), and so | |
| 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). | |
| 17 TestShellPlatformDelegate(const CommandLine& command_line); | |
| 18 ~TestShellPlatformDelegate(); | |
| 19 | |
| 20 // CheckLayoutTestSystemDependencies: check for any system dependencies that | |
| 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. | |
| 23 bool CheckLayoutTestSystemDependencies(); | |
| 24 | |
| 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 | |
| 27 // runtime flags that they can pre-filter. | |
| 28 static void PreflightArgs(int* argc, char*** argv); | |
| 29 | |
| 30 // SuppressErrorReporting: if possible, turn off platform error reporting | |
| 31 // dialogs, crash dumps, etc. | |
| 32 void SuppressErrorReporting(); | |
| 33 | |
| 34 // InitializeGUI: do any special initialization that the UI needs before | |
| 35 // we start the main message loop | |
| 36 void InitializeGUI(); | |
| 37 | |
| 38 // SelectUnifiedTheme: override user preferences so that the UI theme matches | |
| 39 // what's in the baseline files. Whenever possible, override user settings | |
| 40 // here rather than testing them in CheckLayoutTestSystemDependencies. | |
| 41 void SelectUnifiedTheme(); | |
| 42 | |
| 43 // AboutToExit: give the platform delegate a last chance to restore platform | |
| 44 // settings. Normally called by the destructor, but also called before | |
| 45 // abort() (example: test timeouts). | |
| 46 void AboutToExit(); | |
| 47 | |
| 48 // SetWindowPositionForRecording: if the platform's implementation of | |
| 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. | |
| 51 void SetWindowPositionForRecording(TestShell *shell); | |
| 52 private: | |
| 53 const CommandLine& command_line_; | |
| 54 }; | |
| OLD | NEW |