OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/file_path.h" | 6 #include "base/file_path.h" |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 cookie_value.length() > 0 ? cookie_value.c_str() : NULL, | 170 cookie_value.length() > 0 ? cookie_value.c_str() : NULL, |
171 jsvar.length() > 0 ? jsvar.c_str() : NULL, | 171 jsvar.length() > 0 ? jsvar.c_str() : NULL, |
172 js_expr, | 172 js_expr, |
173 js_frame_xpath, | 173 js_frame_xpath, |
174 js_timeout_ms, | 174 js_timeout_ms, |
175 &result); | 175 &result); |
176 | 176 |
177 // Write out the cookie if requested | 177 // Write out the cookie if requested |
178 FilePath cookie_output_path = | 178 FilePath cookie_output_path = |
179 cmd_line->GetSwitchValuePath("wait_cookie_output"); | 179 cmd_line->GetSwitchValuePath("wait_cookie_output"); |
180 if (cookie_output_path.value().size() > 0) { | 180 if (!cookie_output_path.value().empty()) { |
181 ASSERT_TRUE(WriteValueToFile(result.cookie_value, cookie_output_path)); | 181 ASSERT_TRUE(WriteValueToFile(result.cookie_value, cookie_output_path)); |
182 } | 182 } |
183 | 183 |
184 // Write out the JS Variable if requested | 184 // Write out the JS Variable if requested |
185 FilePath jsvar_output_path = cmd_line->GetSwitchValuePath("jsvar_output"); | 185 FilePath jsvar_output_path = cmd_line->GetSwitchValuePath("jsvar_output"); |
186 if (jsvar_output_path.value().size() > 0) { | 186 if (!jsvar_output_path.value().empty()) { |
187 ASSERT_TRUE(WriteValueToFile(result.javascript_variable, | 187 ASSERT_TRUE(WriteValueToFile(result.javascript_variable, |
188 jsvar_output_path)); | 188 jsvar_output_path)); |
189 } | 189 } |
190 } | 190 } |
191 | 191 |
192 } // namespace | 192 } // namespace |
OLD | NEW |