| 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 10 matching lines...) Expand all Loading... |
| 61 // If true, the test_shell will print out the child frame scroll offsets as | 72 // If true, the test_shell will print out the child frame scroll offsets as |
| 62 // well. | 73 // well. |
| 63 DEFINE_BOOL_LAYOUT_TEST_RUNTIME_FLAG(dump_child_frame_scroll_positions) | 74 DEFINE_BOOL_LAYOUT_TEST_RUNTIME_FLAG(dump_child_frame_scroll_positions) |
| 64 | 75 |
| 65 // If true, layout is to target printed pages. | 76 // If true, layout is to target printed pages. |
| 66 DEFINE_BOOL_LAYOUT_TEST_RUNTIME_FLAG(is_printing) | 77 DEFINE_BOOL_LAYOUT_TEST_RUNTIME_FLAG(is_printing) |
| 67 | 78 |
| 68 // If true, don't dump output until notifyDone is called. | 79 // If true, don't dump output until notifyDone is called. |
| 69 DEFINE_BOOL_LAYOUT_TEST_RUNTIME_FLAG(wait_until_done) | 80 DEFINE_BOOL_LAYOUT_TEST_RUNTIME_FLAG(wait_until_done) |
| 70 | 81 |
| 82 // Contents of Accept-Language HTTP header requested by the test. |
| 83 DEFINE_STRING_LAYOUT_TEST_RUNTIME_FLAG(accept_languages) |
| 84 |
| 71 #undef DEFINE_BOOL_LAYOUT_TEST_RUNTIME_FLAG | 85 #undef DEFINE_BOOL_LAYOUT_TEST_RUNTIME_FLAG |
| 86 #undef DEFINE_STRING_LAYOUT_TEST_RUNTIME_FLAG |
| 72 | 87 |
| 73 // Reports whether recursing over child frames is necessary. | 88 // Reports whether recursing over child frames is necessary. |
| 74 bool dump_child_frames() const { | 89 bool dump_child_frames() const { |
| 75 if (dump_as_text()) | 90 if (dump_as_text()) |
| 76 return dump_child_frames_as_text(); | 91 return dump_child_frames_as_text(); |
| 77 else if (dump_as_markup()) | 92 else if (dump_as_markup()) |
| 78 return dump_child_frames_as_markup(); | 93 return dump_child_frames_as_markup(); |
| 79 else | 94 else |
| 80 return dump_child_frame_scroll_positions(); | 95 return dump_child_frame_scroll_positions(); |
| 81 } | 96 } |
| 82 | 97 |
| 83 private: | 98 private: |
| 84 TrackedDictionary dict_; | 99 TrackedDictionary dict_; |
| 85 | 100 |
| 86 DISALLOW_COPY_AND_ASSIGN(LayoutTestRuntimeFlags); | 101 DISALLOW_COPY_AND_ASSIGN(LayoutTestRuntimeFlags); |
| 87 }; | 102 }; |
| 88 | 103 |
| 89 } // namespace test_runner | 104 } // namespace test_runner |
| 90 | 105 |
| 91 #endif // COMPONENTS_TEST_RUNNER_LAYOUT_TEST_RUNTIME_FLAGS_H_ | 106 #endif // COMPONENTS_TEST_RUNNER_LAYOUT_TEST_RUNTIME_FLAGS_H_ |
| OLD | NEW |