Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(150)

Side by Side Diff: components/test_runner/layout_test_runtime_flags.h

Issue 1829253002: Replicate to all renderers the accepted languages set by a layout test. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@splitting-web-frame-test-client
Patch Set: Rebasing... Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | components/test_runner/layout_test_runtime_flags.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « no previous file | components/test_runner/layout_test_runtime_flags.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698