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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 const std::string& wait_js_frame_xpath, | 47 const std::string& wait_js_frame_xpath, |
48 int wait_js_timeout_ms, | 48 int wait_js_timeout_ms, |
49 UrlFetchTestResult* result) { | 49 UrlFetchTestResult* result) { |
50 scoped_refptr<TabProxy> tab(GetActiveTab()); | 50 scoped_refptr<TabProxy> tab(GetActiveTab()); |
51 ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, tab->NavigateToURL(url)); | 51 ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, tab->NavigateToURL(url)); |
52 | 52 |
53 if (wait_cookie_name) { | 53 if (wait_cookie_name) { |
54 if (wait_cookie_value) { | 54 if (wait_cookie_value) { |
55 bool completed = WaitUntilCookieValue( | 55 bool completed = WaitUntilCookieValue( |
56 tab.get(), url, wait_cookie_name, | 56 tab.get(), url, wait_cookie_name, |
57 TestTimeouts::huge_test_timeout_ms(), | 57 TestTimeouts::large_test_timeout_ms(), |
58 wait_cookie_value); | 58 wait_cookie_value); |
59 ASSERT_TRUE(completed); | 59 ASSERT_TRUE(completed); |
60 } else { | 60 } else { |
61 result->cookie_value = WaitUntilCookieNonEmpty( | 61 result->cookie_value = WaitUntilCookieNonEmpty( |
62 tab.get(), url, wait_cookie_name, | 62 tab.get(), url, wait_cookie_name, |
63 TestTimeouts::huge_test_timeout_ms()); | 63 TestTimeouts::large_test_timeout_ms()); |
64 ASSERT_TRUE(result->cookie_value.length()); | 64 ASSERT_TRUE(result->cookie_value.length()); |
65 } | 65 } |
66 } else if (!wait_js_expr.empty()) { | 66 } else if (!wait_js_expr.empty()) { |
67 bool completed = WaitUntilJavaScriptCondition( | 67 bool completed = WaitUntilJavaScriptCondition( |
68 tab.get(), | 68 tab.get(), |
69 UTF8ToWide(wait_js_frame_xpath), | 69 UTF8ToWide(wait_js_frame_xpath), |
70 UTF8ToWide(wait_js_expr), | 70 UTF8ToWide(wait_js_expr), |
71 wait_js_timeout_ms); | 71 wait_js_timeout_ms); |
72 ASSERT_TRUE(completed); | 72 ASSERT_TRUE(completed); |
73 } | 73 } |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 | 173 |
174 // Write out the JS Variable if requested | 174 // Write out the JS Variable if requested |
175 FilePath jsvar_output_path = cmd_line->GetSwitchValuePath("jsvar_output"); | 175 FilePath jsvar_output_path = cmd_line->GetSwitchValuePath("jsvar_output"); |
176 if (!jsvar_output_path.value().empty()) { | 176 if (!jsvar_output_path.value().empty()) { |
177 ASSERT_TRUE(WriteValueToFile(result.javascript_variable, | 177 ASSERT_TRUE(WriteValueToFile(result.javascript_variable, |
178 jsvar_output_path)); | 178 jsvar_output_path)); |
179 } | 179 } |
180 } | 180 } |
181 | 181 |
182 } // namespace | 182 } // namespace |
OLD | NEW |