| 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 COMPONENTS_TEST_RUNNER_LAYOUT_TEST_RUNTIME_FLAGS_H_ | 5 #ifndef COMPONENTS_TEST_RUNNER_LAYOUT_TEST_RUNTIME_FLAGS_H_ |
| 6 #define COMPONENTS_TEST_RUNNER_LAYOUT_TEST_RUNTIME_FLAGS_H_ | 6 #define COMPONENTS_TEST_RUNNER_LAYOUT_TEST_RUNTIME_FLAGS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 | 31 |
| 32 #define DEFINE_BOOL_LAYOUT_TEST_RUNTIME_FLAG(name) \ | 32 #define DEFINE_BOOL_LAYOUT_TEST_RUNTIME_FLAG(name) \ |
| 33 bool name() const { \ | 33 bool name() const { \ |
| 34 bool result; \ | 34 bool result; \ |
| 35 bool found = dict_.current_values().GetBoolean(#name, &result); \ | 35 bool found = dict_.current_values().GetBoolean(#name, &result); \ |
| 36 DCHECK(found); \ | 36 DCHECK(found); \ |
| 37 return result; \ | 37 return result; \ |
| 38 } \ | 38 } \ |
| 39 void set_##name(bool new_value) { dict_.SetBoolean(#name, new_value); } | 39 void set_##name(bool new_value) { dict_.SetBoolean(#name, new_value); } |
| 40 | 40 |
| 41 #define DEFINE_STRING_LAYOUT_TEST_RUNTIME_FLAG(name) \ | |
| 42 std::string name() const { \ | |
| 43 std::string result; \ | |
| 44 bool found = dict_.current_values().GetString(#name, &result); \ | |
| 45 DCHECK(found); \ | |
| 46 return result; \ | |
| 47 } \ | |
| 48 void set_##name(const std::string& new_value) { \ | |
| 49 dict_.SetString(#name, new_value); \ | |
| 50 } | |
| 51 | |
| 52 // If true, the test_shell will generate pixel results in DumpAsText mode. | 41 // If true, the test_shell will generate pixel results in DumpAsText mode. |
| 53 DEFINE_BOOL_LAYOUT_TEST_RUNTIME_FLAG(generate_pixel_results) | 42 DEFINE_BOOL_LAYOUT_TEST_RUNTIME_FLAG(generate_pixel_results) |
| 54 | 43 |
| 55 // If true, the test_shell will produce a plain text dump rather than a | 44 // If true, the test_shell will produce a plain text dump rather than a |
| 56 // text representation of the renderer. | 45 // text representation of the renderer. |
| 57 DEFINE_BOOL_LAYOUT_TEST_RUNTIME_FLAG(dump_as_text) | 46 DEFINE_BOOL_LAYOUT_TEST_RUNTIME_FLAG(dump_as_text) |
| 58 | 47 |
| 59 // If true and if dump_as_text_ is true, the test_shell will recursively | 48 // If true and if dump_as_text_ is true, the test_shell will recursively |
| 60 // dump all frames as plain text. | 49 // dump all frames as plain text. |
| 61 DEFINE_BOOL_LAYOUT_TEST_RUNTIME_FLAG(dump_child_frames_as_text) | 50 DEFINE_BOOL_LAYOUT_TEST_RUNTIME_FLAG(dump_child_frames_as_text) |
| (...skipping 22 matching lines...) Expand all Loading... |
| 84 // don't actually want to open the mail program. | 73 // don't actually want to open the mail program. |
| 85 DEFINE_BOOL_LAYOUT_TEST_RUNTIME_FLAG(policy_delegate_enabled) | 74 DEFINE_BOOL_LAYOUT_TEST_RUNTIME_FLAG(policy_delegate_enabled) |
| 86 | 75 |
| 87 // Toggles the behavior of the policy delegate. If true, then navigations | 76 // Toggles the behavior of the policy delegate. If true, then navigations |
| 88 // will be allowed. Otherwise, they will be ignored (dropped). | 77 // will be allowed. Otherwise, they will be ignored (dropped). |
| 89 DEFINE_BOOL_LAYOUT_TEST_RUNTIME_FLAG(policy_delegate_is_permissive) | 78 DEFINE_BOOL_LAYOUT_TEST_RUNTIME_FLAG(policy_delegate_is_permissive) |
| 90 | 79 |
| 91 // If true, the policy delegate will signal layout test completion. | 80 // If true, the policy delegate will signal layout test completion. |
| 92 DEFINE_BOOL_LAYOUT_TEST_RUNTIME_FLAG(policy_delegate_should_notify_done) | 81 DEFINE_BOOL_LAYOUT_TEST_RUNTIME_FLAG(policy_delegate_should_notify_done) |
| 93 | 82 |
| 94 // Contents of Accept-Language HTTP header requested by the test. | |
| 95 DEFINE_STRING_LAYOUT_TEST_RUNTIME_FLAG(accept_languages) | |
| 96 | |
| 97 #undef DEFINE_BOOL_LAYOUT_TEST_RUNTIME_FLAG | 83 #undef DEFINE_BOOL_LAYOUT_TEST_RUNTIME_FLAG |
| 98 #undef DEFINE_STRING_LAYOUT_TEST_RUNTIME_FLAG | |
| 99 | 84 |
| 100 // Reports whether recursing over child frames is necessary. | 85 // Reports whether recursing over child frames is necessary. |
| 101 bool dump_child_frames() const { | 86 bool dump_child_frames() const { |
| 102 if (dump_as_text()) | 87 if (dump_as_text()) |
| 103 return dump_child_frames_as_text(); | 88 return dump_child_frames_as_text(); |
| 104 else if (dump_as_markup()) | 89 else if (dump_as_markup()) |
| 105 return dump_child_frames_as_markup(); | 90 return dump_child_frames_as_markup(); |
| 106 else | 91 else |
| 107 return dump_child_frame_scroll_positions(); | 92 return dump_child_frame_scroll_positions(); |
| 108 } | 93 } |
| 109 | 94 |
| 110 private: | 95 private: |
| 111 TrackedDictionary dict_; | 96 TrackedDictionary dict_; |
| 112 | 97 |
| 113 DISALLOW_COPY_AND_ASSIGN(LayoutTestRuntimeFlags); | 98 DISALLOW_COPY_AND_ASSIGN(LayoutTestRuntimeFlags); |
| 114 }; | 99 }; |
| 115 | 100 |
| 116 } // namespace test_runner | 101 } // namespace test_runner |
| 117 | 102 |
| 118 #endif // COMPONENTS_TEST_RUNNER_LAYOUT_TEST_RUNTIME_FLAGS_H_ | 103 #endif // COMPONENTS_TEST_RUNNER_LAYOUT_TEST_RUNTIME_FLAGS_H_ |
| OLD | NEW |