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/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 989 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1000 content::WindowedNotificationObserver infobar_observer( | 1000 content::WindowedNotificationObserver infobar_observer( |
1001 chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_ADDED, | 1001 chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_ADDED, |
1002 content::NotificationService::AllSources()); | 1002 content::NotificationService::AllSources()); |
1003 ASSERT_NO_FATAL_FAILURE( | 1003 ASSERT_NO_FATAL_FAILURE( |
1004 ui_test_utils::NavigateToURL(browser(), url)); | 1004 ui_test_utils::NavigateToURL(browser(), url)); |
1005 | 1005 |
1006 // Wait for the translation bar to appear and get it. | 1006 // Wait for the translation bar to appear and get it. |
1007 infobar_observer.Wait(); | 1007 infobar_observer.Wait(); |
1008 InfoBarService* infobar_service = | 1008 InfoBarService* infobar_service = |
1009 InfoBarService::FromWebContents(GetWebContents()); | 1009 InfoBarService::FromWebContents(GetWebContents()); |
1010 TranslateInfoBarDelegate* delegate = | 1010 translate::TranslateInfoBarDelegate* delegate = |
1011 infobar_service->infobar_at(0)->delegate()->AsTranslateInfoBarDelegate(); | 1011 infobar_service->infobar_at(0)->delegate()->AsTranslateInfoBarDelegate(); |
1012 ASSERT_TRUE(delegate); | 1012 ASSERT_TRUE(delegate); |
1013 EXPECT_EQ(translate::TRANSLATE_STEP_BEFORE_TRANSLATE, | 1013 EXPECT_EQ(translate::TRANSLATE_STEP_BEFORE_TRANSLATE, |
1014 delegate->translate_step()); | 1014 delegate->translate_step()); |
1015 | 1015 |
1016 // Simulate translation button press. | 1016 // Simulate translation button press. |
1017 delegate->Translate(); | 1017 delegate->Translate(); |
1018 | 1018 |
1019 content::WindowedNotificationObserver translation_observer( | 1019 content::WindowedNotificationObserver translation_observer( |
1020 chrome::NOTIFICATION_PAGE_TRANSLATED, | 1020 chrome::NOTIFICATION_PAGE_TRANSLATED, |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1266 ASSERT_TRUE(content::ExecuteScript( | 1266 ASSERT_TRUE(content::ExecuteScript( |
1267 GetRenderViewHost(), | 1267 GetRenderViewHost(), |
1268 "document.querySelector('input').autocomplete = 'off';")); | 1268 "document.querySelector('input').autocomplete = 'off';")); |
1269 | 1269 |
1270 // Press the down arrow to select the suggestion and attempt to preview the | 1270 // Press the down arrow to select the suggestion and attempt to preview the |
1271 // autofilled form. | 1271 // autofilled form. |
1272 SendKeyToPopupAndWait(ui::VKEY_DOWN); | 1272 SendKeyToPopupAndWait(ui::VKEY_DOWN); |
1273 } | 1273 } |
1274 | 1274 |
1275 } // namespace autofill | 1275 } // namespace autofill |
OLD | NEW |