OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 #include "chrome/test/base/ui_test_utils.h" | 30 #include "chrome/test/base/ui_test_utils.h" |
31 #include "components/autofill/content/browser/content_autofill_driver.h" | 31 #include "components/autofill/content/browser/content_autofill_driver.h" |
32 #include "components/autofill/content/browser/content_autofill_driver_factory.h" | 32 #include "components/autofill/content/browser/content_autofill_driver_factory.h" |
33 #include "components/autofill/core/browser/autofill_manager.h" | 33 #include "components/autofill/core/browser/autofill_manager.h" |
34 #include "components/autofill/core/browser/autofill_manager_test_delegate.h" | 34 #include "components/autofill/core/browser/autofill_manager_test_delegate.h" |
35 #include "components/autofill/core/browser/autofill_profile.h" | 35 #include "components/autofill/core/browser/autofill_profile.h" |
36 #include "components/autofill/core/browser/autofill_test_utils.h" | 36 #include "components/autofill/core/browser/autofill_test_utils.h" |
37 #include "components/autofill/core/browser/validation.h" | 37 #include "components/autofill/core/browser/validation.h" |
38 #include "components/infobars/core/infobar.h" | 38 #include "components/infobars/core/infobar.h" |
39 #include "components/translate/core/browser/translate_infobar_delegate.h" | 39 #include "components/translate/core/browser/translate_infobar_delegate.h" |
| 40 #include "components/translate/core/browser/translate_manager.h" |
40 #include "content/public/browser/navigation_controller.h" | 41 #include "content/public/browser/navigation_controller.h" |
41 #include "content/public/browser/notification_observer.h" | 42 #include "content/public/browser/notification_observer.h" |
42 #include "content/public/browser/notification_registrar.h" | 43 #include "content/public/browser/notification_registrar.h" |
43 #include "content/public/browser/notification_service.h" | 44 #include "content/public/browser/notification_service.h" |
44 #include "content/public/browser/render_view_host.h" | 45 #include "content/public/browser/render_view_host.h" |
45 #include "content/public/browser/render_widget_host.h" | 46 #include "content/public/browser/render_widget_host.h" |
46 #include "content/public/browser/web_contents.h" | 47 #include "content/public/browser/web_contents.h" |
47 #include "content/public/test/browser_test_utils.h" | 48 #include "content/public/test/browser_test_utils.h" |
48 #include "content/public/test/test_renderer_host.h" | 49 #include "content/public/test/test_renderer_host.h" |
49 #include "net/base/net_errors.h" | 50 #include "net/base/net_errors.h" |
(...skipping 999 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1049 | 1050 |
1050 // Invoke Autofill. | 1051 // Invoke Autofill. |
1051 TryBasicFormFill(); | 1052 TryBasicFormFill(); |
1052 } | 1053 } |
1053 | 1054 |
1054 IN_PROC_BROWSER_TEST_F(AutofillInteractiveTest, AutofillAfterTranslate) { | 1055 IN_PROC_BROWSER_TEST_F(AutofillInteractiveTest, AutofillAfterTranslate) { |
1055 // TODO(port): Test corresponding bubble translate UX: http://crbug.com/383235 | 1056 // TODO(port): Test corresponding bubble translate UX: http://crbug.com/383235 |
1056 if (TranslateService::IsTranslateBubbleEnabled()) | 1057 if (TranslateService::IsTranslateBubbleEnabled()) |
1057 return; | 1058 return; |
1058 | 1059 |
| 1060 translate::TranslateManager::SetIgnoreMissingKeyForTesting(true); |
| 1061 |
1059 CreateTestProfile(); | 1062 CreateTestProfile(); |
1060 | 1063 |
1061 GURL url(std::string(kDataURIPrefix) + | 1064 GURL url(std::string(kDataURIPrefix) + |
1062 "<form action=\"http://www.example.com/\" method=\"POST\">" | 1065 "<form action=\"http://www.example.com/\" method=\"POST\">" |
1063 "<label for=\"fn\">なまえ</label>" | 1066 "<label for=\"fn\">なまえ</label>" |
1064 " <input type=\"text\" id=\"fn\"" | 1067 " <input type=\"text\" id=\"fn\"" |
1065 " onfocus=\"domAutomationController.send(true)\"" | 1068 " onfocus=\"domAutomationController.send(true)\"" |
1066 "><br>" | 1069 "><br>" |
1067 "<label for=\"ln\">みょうじ</label>" | 1070 "<label for=\"ln\">みょうじ</label>" |
1068 " <input type=\"text\" id=\"ln\"><br>" | 1071 " <input type=\"text\" id=\"ln\"><br>" |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1358 ASSERT_TRUE(content::ExecuteScript( | 1361 ASSERT_TRUE(content::ExecuteScript( |
1359 GetRenderViewHost(), | 1362 GetRenderViewHost(), |
1360 "document.querySelector('input').autocomplete = 'off';")); | 1363 "document.querySelector('input').autocomplete = 'off';")); |
1361 | 1364 |
1362 // Press the down arrow to select the suggestion and attempt to preview the | 1365 // Press the down arrow to select the suggestion and attempt to preview the |
1363 // autofilled form. | 1366 // autofilled form. |
1364 SendKeyToPopupAndWait(ui::VKEY_DOWN); | 1367 SendKeyToPopupAndWait(ui::VKEY_DOWN); |
1365 } | 1368 } |
1366 | 1369 |
1367 } // namespace autofill | 1370 } // namespace autofill |
OLD | NEW |