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