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

Side by Side Diff: grit/format/resource_map_unittest.py

Issue 156443002: Provide defines as local variables in if-expressions. (Closed) Base URL: http://grit-i18n.googlecode.com/svn/trunk
Patch Set: rebased past is_posix fix, fixed is_posix again and updated unittests Created 6 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | grit/grd_reader_unittest.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 '''Unit tests for grit.format.resource_map''' 6 '''Unit tests for grit.format.resource_map'''
7 7
8 import os 8 import os
9 import sys 9 import sys
10 if __name__ == '__main__': 10 if __name__ == '__main__':
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 <outputs> 102 <outputs>
103 <output type="rc_header" filename="the_rc_header.h" /> 103 <output type="rc_header" filename="the_rc_header.h" />
104 <output type="resource_map_header" filename="the_rc_map_header.h" /> 104 <output type="resource_map_header" filename="the_rc_map_header.h" />
105 <output type="resource_map_source" filename="the_rc_map_source.cc" /> 105 <output type="resource_map_source" filename="the_rc_map_source.cc" />
106 </outputs> 106 </outputs>
107 <release seq="1" allow_pseudo="false"> 107 <release seq="1" allow_pseudo="false">
108 <messages fallback_to_english="true"> 108 <messages fallback_to_english="true">
109 <message name="IDS_PRODUCT_NAME" desc="The application name"> 109 <message name="IDS_PRODUCT_NAME" desc="The application name">
110 Application 110 Application
111 </message> 111 </message>
112 <if expr="1"> 112 <if expr="True">
113 <message name="IDS_DEFAULT_TAB_TITLE_TITLE_CASE" 113 <message name="IDS_DEFAULT_TAB_TITLE_TITLE_CASE"
114 desc="In Title Case: The default title in a tab."> 114 desc="In Title Case: The default title in a tab.">
115 New Tab 115 New Tab
116 </message> 116 </message>
117 </if> 117 </if>
118 <if expr="0"> 118 <if expr="False">
119 <message name="IDS_DEFAULT_TAB_TITLE" 119 <message name="IDS_DEFAULT_TAB_TITLE"
120 desc="The default title in a tab."> 120 desc="The default title in a tab.">
121 New tab 121 New tab
122 </message> 122 </message>
123 </if> 123 </if>
124 </messages> 124 </messages>
125 </release> 125 </release>
126 </grit>'''), util.PathFromRoot('.')) 126 </grit>'''), util.PathFromRoot('.'))
127 grd.SetOutputLanguage('en') 127 grd.SetOutputLanguage('en')
128 grd.RunGatherers() 128 grd.RunGatherers()
(...skipping 18 matching lines...) Expand all
147 #include "the_rc_header.h" 147 #include "the_rc_header.h"
148 const GritResourceMap kTheRcHeader[] = { 148 const GritResourceMap kTheRcHeader[] = {
149 {"IDS_PRODUCT_NAME", IDS_PRODUCT_NAME}, 149 {"IDS_PRODUCT_NAME", IDS_PRODUCT_NAME},
150 {"IDS_DEFAULT_TAB_TITLE_TITLE_CASE", IDS_DEFAULT_TAB_TITLE_TITLE_CASE}, 150 {"IDS_DEFAULT_TAB_TITLE_TITLE_CASE", IDS_DEFAULT_TAB_TITLE_TITLE_CASE},
151 }; 151 };
152 const size_t kTheRcHeaderSize = arraysize(kTheRcHeader);''', output) 152 const size_t kTheRcHeaderSize = arraysize(kTheRcHeader);''', output)
153 153
154 154
155 if __name__ == '__main__': 155 if __name__ == '__main__':
156 unittest.main() 156 unittest.main()
OLDNEW
« no previous file with comments | « no previous file | grit/grd_reader_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698