| 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/ref_counted.h" | 9 #include "base/ref_counted.h" |
| 10 #include "base/scoped_ptr.h" | 10 #include "base/scoped_ptr.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "chrome/browser/translate/translate_manager.h" | 21 #include "chrome/browser/translate/translate_manager.h" |
| 22 #include "chrome/browser/ui/browser.h" | 22 #include "chrome/browser/ui/browser.h" |
| 23 #include "chrome/browser/ui/browser_window.h" | 23 #include "chrome/browser/ui/browser_window.h" |
| 24 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 24 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 25 #include "chrome/common/net/test_url_fetcher_factory.h" | 25 #include "chrome/common/net/test_url_fetcher_factory.h" |
| 26 #include "chrome/common/render_messages.h" | 26 #include "chrome/common/render_messages.h" |
| 27 #include "chrome/renderer/translate_helper.h" | 27 #include "chrome/renderer/translate_helper.h" |
| 28 #include "chrome/test/in_process_browser_test.h" | 28 #include "chrome/test/in_process_browser_test.h" |
| 29 #include "chrome/test/ui_test_utils.h" | 29 #include "chrome/test/ui_test_utils.h" |
| 30 #include "testing/gtest/include/gtest/gtest.h" | 30 #include "testing/gtest/include/gtest/gtest.h" |
| 31 #include "ui/base/keycodes/keyboard_code_conversion.h" | 31 #include "ui/base/keycodes/keyboard_codes.h" |
| 32 | 32 |
| 33 static const char* kDataURIPrefix = "data:text/html;charset=utf-8,"; | 33 static const char* kDataURIPrefix = "data:text/html;charset=utf-8,"; |
| 34 static const char* kTestFormString = | 34 static const char* kTestFormString = |
| 35 "<form action=\"http://www.example.com/\" method=\"POST\">" | 35 "<form action=\"http://www.example.com/\" method=\"POST\">" |
| 36 "<label for=\"firstname\">First name:</label>" | 36 "<label for=\"firstname\">First name:</label>" |
| 37 " <input type=\"text\" id=\"firstname\"" | 37 " <input type=\"text\" id=\"firstname\"" |
| 38 " onFocus=\"domAutomationController.send(true)\"" | 38 " onFocus=\"domAutomationController.send(true)\"" |
| 39 " /><br />" | 39 " /><br />" |
| 40 "<label for=\"lastname\">Last name:</label>" | 40 "<label for=\"lastname\">Last name:</label>" |
| 41 " <input type=\"text\" id=\"lastname\" /><br />" | 41 " <input type=\"text\" id=\"lastname\" /><br />" |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 // Once click the text field, it starts again. | 344 // Once click the text field, it starts again. |
| 345 ASSERT_TRUE(ui_test_utils::ExecuteJavaScript( | 345 ASSERT_TRUE(ui_test_utils::ExecuteJavaScript( |
| 346 render_view_host(), L"", | 346 render_view_host(), L"", |
| 347 L"cr.googleTranslate.onTranslateElementLoad();")); | 347 L"cr.googleTranslate.onTranslateElementLoad();")); |
| 348 | 348 |
| 349 // Simulate the render notifying the translation has been done. | 349 // Simulate the render notifying the translation has been done. |
| 350 ui_test_utils::WaitForNotification(NotificationType::PAGE_TRANSLATED); | 350 ui_test_utils::WaitForNotification(NotificationType::PAGE_TRANSLATED); |
| 351 | 351 |
| 352 TryBasicFormFill(); | 352 TryBasicFormFill(); |
| 353 } | 353 } |
| OLD | NEW |