| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef CHROME_BROWSER_UI_TEST_TEST_BROWSER_DIALOG_H_ | 5 #ifndef CHROME_BROWSER_UI_TEST_TEST_BROWSER_DIALOG_H_ |
| 6 #define CHROME_BROWSER_UI_TEST_TEST_BROWSER_DIALOG_H_ | 6 #define CHROME_BROWSER_UI_TEST_TEST_BROWSER_DIALOG_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 // ShowDialog(). In a regular test suite run, RunDialog() shows the dialog and | 45 // ShowDialog(). In a regular test suite run, RunDialog() shows the dialog and |
| 46 // immediately closes it (after ensuring it was actually created). | 46 // immediately closes it (after ensuring it was actually created). |
| 47 // | 47 // |
| 48 // To get a list of all available dialogs, run the `BrowserDialogTest.Invoke` | 48 // To get a list of all available dialogs, run the `BrowserDialogTest.Invoke` |
| 49 // test case without other arguments. I.e. | 49 // test case without other arguments. I.e. |
| 50 // | 50 // |
| 51 // browser_tests --gtest_filter=BrowserDialogTest.Invoke | 51 // browser_tests --gtest_filter=BrowserDialogTest.Invoke |
| 52 // | 52 // |
| 53 // Dialogs listed can be shown interactively using the --dialog argument. E.g. | 53 // Dialogs listed can be shown interactively using the --dialog argument. E.g. |
| 54 // | 54 // |
| 55 // browser_tests --gtest_filter=BrowserDialogTest.Invoke --interactive \ | 55 // browser_tests --gtest_filter=BrowserDialogTest.Invoke --interactive |
| 56 // --dialog=FooDialogTest.InvokeDialog_name | 56 // --dialog=FooDialogTest.InvokeDialog_name |
| 57 class TestBrowserDialog { | 57 class TestBrowserDialog { |
| 58 protected: | 58 protected: |
| 59 TestBrowserDialog(); | 59 TestBrowserDialog(); |
| 60 | 60 |
| 61 // Runs the dialog whose name corresponds to the current test case. | 61 // Runs the dialog whose name corresponds to the current test case. |
| 62 void RunDialog(); | 62 void RunDialog(); |
| 63 | 63 |
| 64 // Show the dialog corresponding to |name| and leave it open. | 64 // Show the dialog corresponding to |name| and leave it open. |
| 65 virtual void ShowDialog(const std::string& name) = 0; | 65 virtual void ShowDialog(const std::string& name) = 0; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 82 using DialogBrowserTest = SupportsTestDialog<InProcessBrowserTest>; | 82 using DialogBrowserTest = SupportsTestDialog<InProcessBrowserTest>; |
| 83 | 83 |
| 84 namespace internal { | 84 namespace internal { |
| 85 | 85 |
| 86 // When present on the command line, runs the test in an interactive mode. | 86 // When present on the command line, runs the test in an interactive mode. |
| 87 constexpr const char kInteractiveSwitch[] = "interactive"; | 87 constexpr const char kInteractiveSwitch[] = "interactive"; |
| 88 | 88 |
| 89 } // namespace internal | 89 } // namespace internal |
| 90 | 90 |
| 91 #endif // CHROME_BROWSER_UI_TEST_TEST_BROWSER_DIALOG_H_ | 91 #endif // CHROME_BROWSER_UI_TEST_TEST_BROWSER_DIALOG_H_ |
| OLD | NEW |