OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/string16.h" | 10 #include "base/string16.h" |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 fetcher->set_response_code(success ? 200 : 500); | 183 fetcher->set_response_code(success ? 200 : 500); |
184 fetcher->SetResponseString(script); | 184 fetcher->SetResponseString(script); |
185 fetcher->delegate()->OnURLFetchComplete(fetcher); | 185 fetcher->delegate()->OnURLFetchComplete(fetcher); |
186 } | 186 } |
187 | 187 |
188 void FocusFirstNameField() { | 188 void FocusFirstNameField() { |
189 LOG(WARNING) << "Clicking on the tab."; | 189 LOG(WARNING) << "Clicking on the tab."; |
190 ASSERT_NO_FATAL_FAILURE(ui_test_utils::ClickOnView(browser(), | 190 ASSERT_NO_FATAL_FAILURE(ui_test_utils::ClickOnView(browser(), |
191 VIEW_ID_TAB_CONTAINER)); | 191 VIEW_ID_TAB_CONTAINER)); |
192 ASSERT_TRUE(ui_test_utils::IsViewFocused(browser(), | 192 ASSERT_TRUE(ui_test_utils::IsViewFocused(browser(), |
193 VIEW_ID_TAB_CONTAINER)); | 193 VIEW_ID_TAB_CONTAINER_FOCUS_VIEW)); |
194 | 194 |
195 LOG(WARNING) << "Focusing the first name field."; | 195 LOG(WARNING) << "Focusing the first name field."; |
196 bool result = false; | 196 bool result = false; |
197 ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( | 197 ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( |
198 render_view_host(), L"", | 198 render_view_host(), L"", |
199 L"if (document.readyState === 'complete')" | 199 L"if (document.readyState === 'complete')" |
200 L" document.getElementById('firstname').focus();" | 200 L" document.getElementById('firstname').focus();" |
201 L"else" | 201 L"else" |
202 L" domAutomationController.send(false);", | 202 L" domAutomationController.send(false);", |
203 &result)); | 203 &result)); |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
719 // Once click the text field, it starts again. | 719 // Once click the text field, it starts again. |
720 ASSERT_TRUE(ui_test_utils::ExecuteJavaScript( | 720 ASSERT_TRUE(ui_test_utils::ExecuteJavaScript( |
721 render_view_host(), L"", | 721 render_view_host(), L"", |
722 L"cr.googleTranslate.onTranslateElementLoad();")); | 722 L"cr.googleTranslate.onTranslateElementLoad();")); |
723 | 723 |
724 // Simulate the render notifying the translation has been done. | 724 // Simulate the render notifying the translation has been done. |
725 translation_observer.Wait(); | 725 translation_observer.Wait(); |
726 | 726 |
727 TryBasicFormFill(); | 727 TryBasicFormFill(); |
728 } | 728 } |
OLD | NEW |